zFrank Posted July 3, 2008 Share Posted July 3, 2008 is it possible to search for some types of files using autoit and copy or delete them? i just need some example... thanks in advance. [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
Zedna Posted July 3, 2008 Share Posted July 3, 2008 Look at _FileList2Array(), FileCopy(), FileDelete() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ChrisL Posted July 3, 2008 Share Posted July 3, 2008 This do you? Search ("C:\","advapi32.dll");replace with your search directory and file required Func Search($current,$toFind) If StringRight($current,1) = "\" then $current = StringTrimRight($current,1) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then IF $file = $toFind then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file, $toFind) EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
zFrank Posted July 3, 2008 Author Share Posted July 3, 2008 @ ChrisL hey! Thanks man, you are doing good. one more thing: can i add more dirs/files? [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
Zedna Posted July 3, 2008 Share Posted July 3, 2008 For recursive search search forum for _FileList2ArrayEx() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ChrisL Posted July 3, 2008 Share Posted July 3, 2008 @ ChrisL hey! Thanks man, you are doing good. one more thing: can i add more dirs/files? Your lucky I'm feeling hypo today muttley Local $filesToFind[4] = [3,"advapi32.dll","advpack.dll","audiodev.dll"] Search (@windowsDir,$filesToFind);replace with your search directory and file required Search (@DesktopDir,$filesToFind) Search ("D:\",$filesToFind) Func Search($current,ByRef $toFind) If StringRight($current,1) = "\" then $current = StringTrimRight($current,1) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then If IsArray($toFind) then For $i = 1 to Ubound($toFind) -1 IF $file = $toFind[$i] then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here Next Else IF $file = $toFind then Msgbox(0,"File found", $current & "\" & $file); you could add it to an array delete it or whatever else you wanted to do with it here EndIf EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file, $toFind) EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
zFrank Posted July 3, 2008 Author Share Posted July 3, 2008 @ ChrisLTons of thankses and also a big Thanks. [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
zFrank Posted July 3, 2008 Author Share Posted July 3, 2008 For recursive search search forum for _FileList2ArrayEx()i got only the current thread by searching this word. _FileList2ArrayEx()nothing exists in this forum like this. [font="Georgia"]GSM Expert[/font] but not AutoIt :DProud to be Admin Of : http://www.gsmhosting.net/visit my Forum... http://www.gsmhosting.net/vbb/index.php$Life = "Happy" If @Error Then $Life = "Risk" Link to comment Share on other sites More sharing options...
ChrisL Posted July 3, 2008 Share Posted July 3, 2008 By the way what I posted is recursive to, so if you search C:\ it will search all folders and sub-folders on that drive [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Zedna Posted July 3, 2008 Share Posted July 3, 2008 i got only the current thread by searching this word. _FileList2ArrayEx()nothing exists in this forum like this.Sorry my bad. Correct one is _FileListToArrayEx()http://www.autoitscript.com/forum/index.php?showtopic=33930 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now