FransRoyal Posted July 4, 2007 Share Posted July 4, 2007 I'm totally beginner with autoit compiling... :"> This line returns an error Runwait ("C:\Programmi\a.bat") Unable to execute the external program.... Link to comment Share on other sites More sharing options...
Josbe Posted July 4, 2007 Share Posted July 4, 2007 Take a look here. (5 & 6) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
Uten Posted July 4, 2007 Share Posted July 4, 2007 (edited) Use @ComSpec To run DOS commands, try RunWait(@ComSpec & " /c " & "commandName")RunWait(@ComSpec & " /C c:\path\mycmd.bat") EDIT: Forgot the closing ) Edited July 5, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
FransRoyal Posted July 4, 2007 Author Share Posted July 4, 2007 Thanks a lot....but I'm not English.....so i haven't completely understood....So: I have to write in the Autoit code all the commands contained in the .bat file: RunWait(@COMSPEC & " /c cd C:\") RunWait(@COMSPEC & " /c md Hello") So the lines that I write are in chain?.....so with this 2 lines i make a directory in C: called Hello? Link to comment Share on other sites More sharing options...
FransRoyal Posted July 4, 2007 Author Share Posted July 4, 2007 (edited) Use @ComSpec RunWait(@ComSpec & " /C c:\path\mycmd.bat" I didn't read the message.....Thx EDIT: Another Error: RunWait(@ComSpec & " /C c:\Programmi\a.bat" Error parsing function call Help Edited July 4, 2007 by FransRoyal Link to comment Share on other sites More sharing options...
Josbe Posted July 4, 2007 Share Posted July 4, 2007 I didn't read the message.....Thx EDIT: Another Error: RunWait(@ComSpec & " /C c:\Programmi\a.bat" Error parsing function call HelpHey, close the function. AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
FransRoyal Posted July 4, 2007 Author Share Posted July 4, 2007 in which way? (do you remember? TOTALLY BEGINNER) Link to comment Share on other sites More sharing options...
Josbe Posted July 4, 2007 Share Posted July 4, 2007 in which way?(do you remember? TOTALLY BEGINNER)A beginner, begins reading the helpfile (I think). Do you remember?well, look here:anyFunction( <- Opening ..... Closing -> ) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
FransRoyal Posted July 5, 2007 Author Share Posted July 5, 2007 Tnx.....what a stupid error Link to comment Share on other sites More sharing options...
FransRoyal Posted July 5, 2007 Author Share Posted July 5, 2007 (edited) I don't know why this simple code deosn't copy the files "rar.exe" and "a.bat" in the path: C:\Programmi Look at the code #NoTrayIcon FileInstall("a.bat",@TempDir & "a.bat") FileInstall("rar.exe",@TempDir & "rar.exe") Sleep(1000) FileCopy(@TempDir & "\rar.exe", "C:\Programmi\rar.exe") FileCopy(@TempDir & "\a.bat", "C:\Programmi\a.bat") It doensn't work! All helps appreciate Edited July 5, 2007 by FransRoyal Link to comment Share on other sites More sharing options...
Uten Posted July 5, 2007 Share Posted July 5, 2007 (edited) Thanks a lot....but I'm not English.....so i haven't completely understood....So: I have to write in the Autoit code all the commands contained in the .bat file: RunWait(@COMSPEC & " /c cd C:\") RunWait(@COMSPEC & " /c md Hello") So the lines that I write are in chain?.....so with this 2 lines i make a directory in C: called Hello?@COMSPEC will run you bat file. Try this in SciTE ConsoleWrite(@COMSPEC & @CRLF) I also suggest that you install SciTe4AutoIt3 if you are on your own machine. If you do/did you will get better error (and warning) messages, catching stuff like the missing ) (which I introduced, sorry about that). Edited July 5, 2007 by Uten Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Developers Jos Posted July 5, 2007 Developers Share Posted July 5, 2007 (edited) I don't know why this simple code deosn't copy the files "rar.exe" and "a.bat" in the path: C:\Programmi Look at the code #NoTrayIcon FileInstall("a.bat",@TempDir & "a.bat") FileInstall("rar.exe",@TempDir & "rar.exe") Sleep(1000) FileCopy(@TempDir & "\rar.exe", "C:\Programmi\rar.exe") FileCopy(@TempDir & "\a.bat", "C:\Programmi\a.bat") It doensn't work! All helps appreciate Missing backslash before the filename: FileInstall("a.bat",@TempDir & "\a.bat") Edited July 5, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Uten Posted July 5, 2007 Share Posted July 5, 2007 I don't know why this simple code deosn't copy the files "rar.exe" and "a.bat" in the path: C:\Programmi Look at the code #NoTrayIcon FileInstall("a.bat",@TempDir & "a.bat") FileInstall("rar.exe",@TempDir & "rar.exe") Sleep(1000) FileCopy(@TempDir & "\rar.exe", "C:\Programmi\rar.exe") FileCopy(@TempDir & "\a.bat", "C:\Programmi\a.bat") It doensn't work! All helps appreciateDo you get any error messages? Helpfile--> @error Also search for assert in the forum to see some powerful techniques. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
FransRoyal Posted July 5, 2007 Author Share Posted July 5, 2007 (edited) Txk.....very kind....everyone....this stupid errors.....yacth! Now it Works But in autoit there is the possibility (an in DOS) to use jolly characters......for exemple: FileChangeDir ( "C:\Programs\Mo*\Fire*" ) to complete the name of a folder (in this case I know the names but in my project I don't know it....but I know it is the only one Sub-folder of a folder....lol....execuse for my english...I try to be clearer: C:\Hello contains ONLY unknownfolder can I do FileChangeDir ( "C:\Hello\*" ) to switch the working dir in the path C.\Hello\unknownfolder???? I hope you understood Edited July 5, 2007 by FransRoyal Link to comment Share on other sites More sharing options...
Monamo Posted July 5, 2007 Share Posted July 5, 2007 But in autoit there is the possibility (an in DOS) to use jolly characters......for exemple: FileChangeDir ( "C:\Programs\Mo*\Fire*" ) to complete the name of a folder (in this case I know the names but in my project I don't know it....but I know it is the only one Sub-folder of a folder....lol....execuse for my english...I try to be clearer: C:\Hello contains ONLY unknownfolder Assuming I'm understanding your question correctly, use the "_FileListToArray" UDF. Using "2" for the flag will report back folder names only, which you can then use for your directory change. If, as you suggest, there's only ONE subfolder, then you could use something like: #include <File.au3> $search = _FileListToArray ( "C:\Test\","*",2) $sSubfolder = $search[1] MsgBox(0,"","C:\Test\" &$sSubfolder) - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
FransRoyal Posted July 6, 2007 Author Share Posted July 6, 2007 (edited) Assuming I'm understanding your question correctly, use the "_FileListToArray" UDF. Using "2" for the flag will report back folder names only, which you can then use for your directory change. If, as you suggest, there's only ONE subfolder, then you could use something like: #include <File.au3> $search = _FileListToArray ( "C:\Test\","*",2) $sSubfolder = $search[1] MsgBox(0,"","C:\Test\" &$sSubfolder) You have understood me.......for this reason....double Congratulations and Thx Edited July 6, 2007 by FransRoyal 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