FireFox Posted January 20, 2009 Posted January 20, 2009 Hi, I want to search folders, like filefindfirstfile. I know this exists but Ive done a lot of search without find nothing (folder search / find etc..) Please redirect me to this UDF Cheers, FireFox.
Moderators Melba23 Posted January 20, 2009 Moderators Posted January 20, 2009 (edited) FireFox, Here is a recursive search script. A bit of tweaking should get want you want:; $current = start folder, $toFind = filename (will accept wildcards) Func Search($current,$toFind) If StringRight($current,1) <> "\" then $current &= "\" Local $search_handle = FileFindFirstFile($current & "*.*") While 1 $file_found = FileFindNextFile($search_handle) If @error Or StringLen($file_found) < 1 Then ExitLoop If StringInStr(FileGetAttrib($current & $file_found), "D") And ($file_found <> "." Or $file_found <> "..") Then ; Search this subfolder Search($current & $file_found, $toFind) Else ; Found file EndIf WEnd FileClose($search_handle) EndFunc M23 Edited January 20, 2009 by Melba23 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
Moderators Melba23 Posted January 20, 2009 Moderators Posted January 20, 2009 (edited) Andreik, Thank you for that. Amazing what is hidden in the Help file - if only I could remember it all! M23 Edit: But it is not recursive, alas. Edited January 20, 2009 by Melba23 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
DerMedizinmann Posted April 10, 2009 Posted April 10, 2009 Hey Guys, i just wrote a little script that recursively scans a folder for all its subfolders. Results are returned as a one-dimensional array. The prog runs fast and reliable. Source code is attached to this message. Comments welcome. Have fun. MarcusGetSubfolders.au3
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