Ices 0 Posted January 4, 2005 (edited) I want my script to open a command prompt, do a directory list, then make a text file, and copying the directory list to the text file. Opening the command prompt and making the text file I got, but how would I get the directory list from the command prompt to the text file? Any ideas? Also, if I can get a directory list without the use of a command line, I could do that instead, Im open to suggestions Edited January 4, 2005 by Ices Share this post Link to post Share on other sites
ezzetabi 3 Posted January 4, 2005 (edited) May help... $sDirectory = 'c:\';Put the directory name here $sOutPutFile = 'd:\test.txt';Put the output file name here If StringRight($sDirectory,1) <> '\' Then $sDirectory = $sDirectory & '\' $iHandle = FileFindFirstFile($sDirectory & '*.*') While $iHandle <> -1 $sFileName = FileFindNextFile($iHandle) If @error Then FileClose($iHandle) ExitLoop EndIf $sList = $sList & @CRLF & $sDirectory & $sFileName WEnd $sList = StringTrimLeft($sList,2);Remove the heading @crlf FileDelete($sOutPutFile) FileWrite($sOutPutFile,$sList) Edited January 4, 2005 by ezzetabi Share this post Link to post Share on other sites
buzz44 1 Posted January 4, 2005 use this to run a hidden cmd window and get dir #include <Process.au3> _RunDos("Dir" & " > " & @TempDir & "\temp.txt") Change @TempDir & "\temp.txt", to the place you want to same the text file as, and also change "dir" by first opening the directory to get files/fodler of qq Share this post Link to post Share on other sites
Ices 0 Posted January 4, 2005 Thanks Much ezzetabi, it worked great. Im almost done with my program Share this post Link to post Share on other sites