hcdebey Posted April 28, 2008 Share Posted April 28, 2008 I want create a list of files in a directory with something like: C:\>dir >filelist.txt When I attempt this using ShellExecute I get a message that Windows can't find dir. Any suggestions? Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 28, 2008 Share Posted April 28, 2008 I want create a list of files in a directory with something like: C:\>dir >filelist.txt When I attempt this using ShellExecute I get a message that Windows can't find dir. Any suggestions? There is no DIR.exe to run. The DIR command is "native to", or "embedded in" the command shell (i.e. CMD.exe). So for AutoIt to run an embedded command, you first run the shell: Run(@ComSpec & " /c DIR C:\Temp1 > C:\Temp2.txt") You can skip all that and get the list to an array with just _FileListToArray(). Check it out in the help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Zedna Posted April 28, 2008 Share Posted April 28, 2008 (edited) RunWait(@COMSPEC & " /c Dir C:\")Also look at _FileListToArray()EDIT: PsaltyDS is winner but our minds are almost the same :-) Edited April 28, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
covaks Posted April 28, 2008 Share Posted April 28, 2008 If you wanted to do it that way.. Run(@ComSpec & " /c dir > file.txt")oÝ÷ Ø è¶«Á¬²¢é¢pj{m¢ÚòËaÆ®¶sb6æ6ÇVFRfÇC´fÆRæS2fwC°¢6æ6ÇVFRfÇC´'&æS2fwC° ¢b33c¶bÒôfÆTÆ7EFô'&gV÷C´3¢b3#µvæF÷w2gV÷C²ÂgV÷C²¢â¢gV÷C²Ã¥ô'&F7Æb33c¶b Link to comment Share on other sites More sharing options...
hcdebey Posted April 28, 2008 Author Share Posted April 28, 2008 Thanks. Your suggestion is much better. 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