Trong Posted February 12, 2013 Share Posted February 12, 2013 For example, the folders and files tree follows: (folder)- C:\FolderName ( file ) -- SysAnti.exe (folder) -- SubDir1 ( file ) --- File1.Ext ( file ) --- Filex.exe ( file ) --- Filen.tmp (folder) -- SubDir2 ( file ) --- Forever.exe ( file ) --- SysAnti.exe ( file ) --- Autorun.inf (folder) -- SubDirn ( file ) --- cFile1.Ext ( file ) --- cFilex.exe (folder) --- C:\FolderName\SubDirn (folder) --- SubofSubDir1 ( file ) ---- dFile1.Ext ( file ) ---- dFilex.exe ( file ) ---- dFilen.tmp (folder) ---- SysAnti (folder) --- Forever ( file ) ---- SysAnti.abv (folder) --- SysAntiAutorunSysAnti ( file ) ---- Forever ( file ) ---- SysAnti ( file ) ---- AutorunI want to find all files and Folders name "SysAnti" in folder C:\FolderName (Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti","File=1","Folder=0","Subdir=1") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SysAnti.exeC:\FolderName\SubDir2\SysAnti.exeC:\FolderName\SubDirn\Forever\SysAnti.abvC:\FolderName\SubDirn\SysAntiAutorunSysAntiC:\FolderName\SubDirn\SubofSubDir1\SysAntiC:\FolderName\SubDirn\SysAntiAutorunSysAnti\SysAntiI want to find all files name "SysAnti" with any file extension in folder C:\FolderName (Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti.*","File=1","Folder=0","Subdir=1") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SysAnti.exeC:\FolderName\SubDir2\SysAnti.exeC:\FolderName\SubDirn\Forever\SysAnti.abvC:\FolderName\SubDirn\SysAntiAutorunSysAnti\SysAntiI want to find all files name "SysAnti" with any file extension in folder C:\FolderName (NO Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti.*","File=1","Folder=0","Subdir=0") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SysAnti.exeI want to find all files name "SysAnti" with extension ".exe" in folder C:\FolderName (Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti.exe","File=1","Folder=0","Subdir=1") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SysAnti.exeC:\FolderName\SubDir2\SysAnti.exeI want to find all files name "SysAnti" with extension ".exe" in folder C:\FolderName (NO Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti.exe","File=1","Folder=0","Subdir=0") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SysAnti.exeI want to find all Folders name "SysAnti" in folder C:\FolderName (Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti","File=0","Folder=1","Subdir=1") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SubDirn\SubofSubDir1\SysAntiI want to find all Folders name "*SysAnti" in folder C:\FolderName (Including subfolders!)$a= _FindIt( "C:\FolderName","SysAnti","File=0","Folder=1","Subdir=1") ConsoleWrite($a & @CRLF)-> Return:C:\FolderName\SubDirn\SubofSubDir1\SysAntiC:\FolderName\SubDirn\SysAntiAutorunSysAntiFunc _FindIt($1,$2,$3,$4,$5) ??? EndFuncSo, how to write Func _FindIt ???What is the content of _FindIt ???Help me to finish it Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 12, 2013 Moderators Share Posted February 12, 2013 Trong,My RecFileListToArray UDF will do exactly what you want - the link is in my sig. please ask if you have any trouble getting it to work as you require. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Trong Posted February 12, 2013 Author Share Posted February 12, 2013 Thank you Melba23 !I'll try it right now! Regards, Link to comment Share on other sites More sharing options...
Trong Posted February 12, 2013 Author Share Posted February 12, 2013 Excellent!Although the UDF too many lines! ^ ^and have little problem with Func BitAnd, but it was solved with the standard version of AutoIt! Regards, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 12, 2013 Moderators Share Posted February 12, 2013 Trong,Although the UDF too many lines!Please do not start down that road as well - I get quite enough of that from Tlem and Spiff59! If you want a UDF that is as flexible and comprehensive as I believe that one to be, it is going to take a fair few lines of code. Anyway all you need in your own script is a single #include line. But I am glad you found it useful and that it did what you wanted. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Trong Posted February 12, 2013 Author Share Posted February 12, 2013 You're funny, I like you! ^^ Thank you very much! Regards, 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