Ag3nt0rang3 Posted April 23, 2009 Share Posted April 23, 2009 I have a number of lines that i need to run in cmd but i have no idea how to use comspec, could someone conver these .bat codes to autoit ? 1. cd /d "C:\Program Files (x86)\Silkroad\ScreenShot" ren *.jpg *.bak 2. @echo off cd /d "%~dp0decode" for %%f in ("C:\Program Files (x86)\Silkroad\ScreenShot\*.jpg") do java -cp decode.jar captcha.Main "%%~f" "%~dp0code.txt" cd /d "%~dp0" type code.txt thanx in advance Link to comment Share on other sites More sharing options...
Developers Jos Posted April 23, 2009 Developers Share Posted April 23, 2009 You can write this in native AutoIt3 syntax. just open the helpfile and look for the proper functions. Jos 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...
Ag3nt0rang3 Posted April 23, 2009 Author Share Posted April 23, 2009 No offence jos but that did not help at all. I NEED them to run at comspec level and have no idea how to use @COMSPEC. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 23, 2009 Developers Share Posted April 23, 2009 (edited) No offence jos but that did not help at all. I NEED them to run at comspec level and have no idea how to use @COMSPEC.No offence back, but then just simply put it in a batch file and use Run() or ShellExecute() to run the batch file.There are a zillion examples in these forums on how to run something with @comspec Edited April 23, 2009 by Jos 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...
Ag3nt0rang3 Posted April 23, 2009 Author Share Posted April 23, 2009 (edited) Ok I did the first one - i feel kinda stupid now ... FileMove($spath & "\*.jpg", $spath & "\*.bak") But how the hell do i do the second one in autoit? Edited April 23, 2009 by Ag3nt0rang3 Link to comment Share on other sites More sharing options...
Developers Jos Posted April 23, 2009 Developers Share Posted April 23, 2009 (edited) These should do it: FileChangeDir() FileFindFirstFile() While 1 FileFindNextFile() If @error then ExitLoop RunWait( java......) Wend FileChangeDir() ShellExecute(logfile) Jos Edited April 23, 2009 by Jos 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...
Ag3nt0rang3 Posted April 23, 2009 Author Share Posted April 23, 2009 I dont actually understand what the second.bat file is doing. Could you possibly write it in autoit for me. sorry to be a pain and thnx for your help so far. Link to comment Share on other sites More sharing options...
Juvigy Posted April 24, 2009 Share Posted April 24, 2009 You have the 2 bat files right? Just do the following in autoit: RunWait ( "C:\batfile1.bat") RunWait ( "C:\batfile2.bat") 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