ezzetabi Posted April 27, 2004 Share Posted April 27, 2004 Ok, this is not well formatted UFD, but more a scrap of code that I'll use in mine shell extension. But since I think that can be useful I post it here. expandcollapse popup$Path = "C:\Scripts" ;<---- The path where all begins... dim $folders[2] $Files = "" $dirs = "" $result = "" If StringInStr(FileGetAttrib($path),"d") Then $folders[0] = 1 $folders[1] = $Path While 1 For $c = 1 to $folders[0] If StringRight($folders[$c],1) == "\" Then $Folders[$c] = StringLeft($folders[$c],StringLen($folders[$c])-1) $search = FileFindFirstFile($folders[$c] & "\*.*") If $search <> -1 Then While 1 $result = FileFindNextFile($search) If @error Then ExitLoop If $result <> "." AND $result <> ".." Then $result = $folders[$c] & "\" & $result If StringInStr(FileGetAttrib($result),"d") Then $dirs = $dirs & "|" & $result $files = $files & "|" & $result ; << --- Remove this line if you do not want the folders names in the final list... ;or use an other var if you want divide. Else $files = $files & "|" & $result EndIf EndIf WEnd FileClose($search) EndIf Next If $dirs = "" Then ExitLoop $folders = 0 $dirs = StringRight($dirs,StringLen($dirs) - 1) $folders = StringSplit($dirs,"|") $dirs = "" WEnd Else ;You decide what to do if $path is not a folder EndIf $files = StringRight($files,StringLen($files) - 1) $files = StringReplace($files,"|",@crlf) FileWrite("c:\list.txt",$files) Link to comment Share on other sites More sharing options...
konan Posted January 14, 2005 Share Posted January 14, 2005 Thank you! It is good! Link to comment Share on other sites More sharing options...
SlimShady Posted January 14, 2005 Share Posted January 14, 2005 I don't understand what the difference is between Larry's version and yours. Link to comment Share on other sites More sharing options...
ezzetabi Posted January 15, 2005 Author Share Posted January 15, 2005 (edited) I do not even remember I made this script... Who recalled this old topic? Edit: btw.. I made few testes and it seems actualy faster than both mine _FileSearch and Larry's one. Really interesting... Edit2: I compared different folder. It is actually fast as other two. Edited January 15, 2005 by ezzetabi Link to comment Share on other sites More sharing options...
Tekkion Posted March 18, 2014 Share Posted March 18, 2014 I didn't try to understand the above script completly now but am I wrong if I suspect that you need a recursive script to include all subfolders in the search and that this script only read the first subfolders found in the main folder? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 18, 2014 Moderators Share Posted March 18, 2014 Tekkion,Did you notice the date in the post above yours? do you really expect a replay after 9 years? In future please engage your brain before hitting the "Submit" button. M23P.S. And look at _FileListToArrayRec in the Help file - unsuprisingly there is now a standard include function to search within folder trees. 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...
Recommended Posts