| View previous topic :: View next topic |
| Author |
Message |
zendevelop
Joined: 21 Aug 2008 Posts: 8
|
Posted: Mon Aug 03, 2009 8:18 am Post subject: Execute a series of command in console window |
|
|
Hello, I want to use ahk to write a script to auto execute a series of command in console window( just like auto update code from svn server and compile it ).
How could I know the executing command has completed and so I can execute the next command in ahk script. |
|
| Back to top |
|
 |
Gosugenji
Joined: 07 May 2008 Posts: 87 Location: In your Internets
|
Posted: Mon Aug 03, 2009 8:19 am Post subject: |
|
|
runwait , svndownload.exe -s (servername) ;an example of course
run , compile.exe (pathtofile) |
|
| Back to top |
|
 |
zendevelop
Joined: 21 Aug 2008 Posts: 8
|
Posted: Mon Aug 03, 2009 8:50 am Post subject: |
|
|
runwait is run an external program, but I just run the svn update and compile in console window, the whole steps like below:
1) run command.exe
2) change to the sepcified directory
3) input "svn update" to update code
4) input "make" to compile source
my question is how could I know the "svn update" run in windows command.exe has completed and I can input "make" to compile my source code. |
|
| Back to top |
|
 |
HeWhoWas
Joined: 03 Aug 2009 Posts: 86 Location: Australia (Sydney)
|
Posted: Mon Aug 03, 2009 9:47 am Post subject: |
|
|
| Why don't you do this in a batch file? Just curious. |
|
| Back to top |
|
 |
Chavez
Joined: 20 Aug 2008 Posts: 256
|
Posted: Mon Aug 03, 2009 11:03 am Post subject: |
|
|
| HeWhoWas wrote: | | Why don't you do this in a batch file? Just curious. |
To be more specific:
| Code: |
directory = "C:\" ; This is your 'specified' directory
FileAppend, @ECHO off`ncd %directory%`nsvn update`nmake, %TEMP%\temp.bat ; Here you create a batch file
Run, %TEMP%\temp.bat ; Run the batch file
FileDelete, %TEMP%\temp.bat ; Delete the batch file
|
Untested _________________ -Chavez. |
|
| Back to top |
|
 |
HeWhoWas
Joined: 03 Aug 2009 Posts: 86 Location: Australia (Sydney)
|
Posted: Mon Aug 03, 2009 11:09 am Post subject: |
|
|
| What I was trying to say is AHK seems to be an unnecessary middle man. Couldn't a batch script just take care of this? |
|
| Back to top |
|
 |
Chavez
Joined: 20 Aug 2008 Posts: 256
|
Posted: Mon Aug 03, 2009 11:10 am Post subject: |
|
|
| HeWhoWas wrote: | | What I was trying to say is AHK seems to be an unnecessary middle man. Couldn't a batch script just take care of this? |
Maybe he wants to use this code as part of a bigger program or whatsoever, in that case, he could use my example. _________________ -Chavez. |
|
| Back to top |
|
 |
zendevelop
Joined: 21 Aug 2008 Posts: 8
|
Posted: Mon Aug 03, 2009 1:03 pm Post subject: |
|
|
| Chavez wrote: | | HeWhoWas wrote: | | Why don't you do this in a batch file? Just curious. |
To be more specific:
| Code: |
directory = "C:\" ; This is your 'specified' directory
FileAppend, @ECHO off`ncd %directory%`nsvn update`nmake, %TEMP%\temp.bat ; Here you create a batch file
Run, %TEMP%\temp.bat ; Run the batch file
FileDelete, %TEMP%\temp.bat ; Delete the batch file
|
Untested |
I want the whole command run in cygwin console window, not windows command.exe envrionment(because my "make" need run in cygwin envrionment ), could this run in cygwin envrionment?
I am not familiar with batch file, and when I study ahk, I want to implement the function in ahk script, so have this question. |
|
| Back to top |
|
 |
|