mortalic Posted September 5, 2007 Share Posted September 5, 2007 Hello all, Still a noob, but I'm getting better! So now I am trying to run through all the files in a diretory, here is what I am doing: Dim $i_PID Dim $search $search = FileFindFirstFile("<pathtofile>\FI431*.exe") if $search = -1 Then MsgBox(0,"Error", "No files found") Exit EndIf While 1 $file = FileFindNextFile($search) if @error then ExitLoop $i_PID = Run("<pathtofile>" & $file) While ProcessExists($i_PID) sleep(100) Wend WEnd the problem is, autoit doesn't do the same sorting as windows does, which causes the files to get evaluated out of order. In windows the files sort correctly Example: file00001_019.exe file00020_117.exe file00118_148.exe but autoit, using the filefindfirst code above reports them in this order: file00020_117.exe file00001_019.exe file00118_148.exe I'm not sure why it is doing that, it doesn't seem to make any sense, 019 is definatly lower than 117, but as you can see from the naming convention, it is denoting 1 through 19, 20 through 117, 118 through 148. and like I said, windows displays it differently. Any ideas? Link to comment Share on other sites More sharing options...
Zedna Posted September 5, 2007 Share Posted September 5, 2007 Look into helpfile at: _FileListToArray() _ArraySort() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
mortalic Posted September 5, 2007 Author Share Posted September 5, 2007 Look into helpfile at: _FileListToArray()_ArraySort()ahh good call, dump it to an array, sort the array, then run it in order. Thanks! I'll pose if I get stuck. Link to comment Share on other sites More sharing options...
mortalic Posted September 6, 2007 Author Share Posted September 6, 2007 ok I'm stumped, So I've narrowed my code down to this: #Include <File.au3> #Include <Array.au3> $fileList=_FileListToArray("FI*.exe") If @Error=1 Then MsgBox(0,"","No files found") Exit EndIf _ArrayDisplay($fileList,"File List") But nothing happens when I run the script, no output, nothing. script, runs then exits. It's right out of the f1 help file, what am I doing wrong? Link to comment Share on other sites More sharing options...
Zedna Posted September 6, 2007 Share Posted September 6, 2007 ok I'm stumped, So I've narrowed my code down to this: #Include <File.au3> #Include <Array.au3> $fileList=_FileListToArray("FI*.exe") If @Error=1 Then MsgBox(0,"","No files found") Exit EndIf _ArrayDisplay($fileList,"File List") But nothing happens when I run the script, no output, nothing. script, runs then exits. It's right out of the f1 help file, what am I doing wrong? Did you looked into helpfile at parametres for _FileListToArray ?!? #Include <File.au3> #Include <Array.au3> $fileList=_FileListToArray("C:\some path\", "FI*.exe") If @Error=1 Then MsgBox(0,"","No files found") Exit EndIf _ArrayDisplay($fileList,"File List") Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
mortalic Posted September 6, 2007 Author Share Posted September 6, 2007 Did you looked into helpfile at parametres for _FileListToArray ?!? #Include <File.au3> #Include <Array.au3> $fileList=_FileListToArray("C:\some path\", "FI*.exe") If @Error=1 Then MsgBox(0,"","No files found") Exit EndIf _ArrayDisplay($fileList,"File List") Well yeah... My code is practically verbatim from the help file... did I miss something? Link to comment Share on other sites More sharing options...
cdkid Posted September 6, 2007 Share Posted September 6, 2007 Missed a parameter in _FileListToArray... ~cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
mortalic Posted September 7, 2007 Author Share Posted September 7, 2007 Missed a parameter in _FileListToArray...~cdkidAhh good call, I'll take a look at that. 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