tony01 Posted January 2, 2006 Share Posted January 2, 2006 Hi Everybody: Does anyone have a script that will print out directories and subdirectories from a given directory? ( I don't want to print files, print just dirs and subdirs). Thanks Tony. Link to comment Share on other sites More sharing options...
trids Posted January 3, 2006 Share Posted January 3, 2006 Use RunWait to execute the DOS dir command ..dir _target_folder_ /s /b /ad > output.txtHTH Link to comment Share on other sites More sharing options...
BigDod Posted January 3, 2006 Share Posted January 3, 2006 You may find something to help you Here Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
seandisanti Posted January 3, 2006 Share Posted January 3, 2006 You may find something to help you Heremine is on the list linked to, but i modified the code a little to suit your purpose... But i think the dos dir method mentioned may be faster... $tosearch = "C:" $output = FileOpen("c:\filelist.txt",2) $start = TimerInit() RecFileSearch($tosearch) FileClose($output) MsgBox(0,"done","it only took " & int(TimerDiff($start)/1000) & " seconds") Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then RecFileSearch($current & "\" & $file) FileWriteLine($output,$current & "\" & $file & " " & DirGetSize($file)) WEnd FileClose($search) EndFunc Link to comment Share on other sites More sharing options...
tony01 Posted January 4, 2006 Author Share Posted January 4, 2006 It works. I like the dos command : dir _target_folder_ /s /b /ad > output.txt, thank you trids. Short, Fast and clean. Thank you cameronsdad for the long version. Cheers Tony 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