AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Execute a series of command in console window

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
zendevelop



Joined: 21 Aug 2008
Posts: 8

PostPosted: Mon Aug 03, 2009 8:18 am    Post subject: Execute a series of command in console window Reply with quote

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
View user's profile Send private message
Gosugenji



Joined: 07 May 2008
Posts: 87
Location: In your Internets

PostPosted: Mon Aug 03, 2009 8:19 am    Post subject: Reply with quote

runwait , svndownload.exe -s (servername) ;an example of course
run , compile.exe (pathtofile)
Back to top
View user's profile Send private message
zendevelop



Joined: 21 Aug 2008
Posts: 8

PostPosted: Mon Aug 03, 2009 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message
HeWhoWas



Joined: 03 Aug 2009
Posts: 86
Location: Australia (Sydney)

PostPosted: Mon Aug 03, 2009 9:47 am    Post subject: Reply with quote

Why don't you do this in a batch file? Just curious.
Back to top
View user's profile Send private message AIM Address MSN Messenger
Chavez



Joined: 20 Aug 2008
Posts: 256

PostPosted: Mon Aug 03, 2009 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
HeWhoWas



Joined: 03 Aug 2009
Posts: 86
Location: Australia (Sydney)

PostPosted: Mon Aug 03, 2009 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address MSN Messenger
Chavez



Joined: 20 Aug 2008
Posts: 256

PostPosted: Mon Aug 03, 2009 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
zendevelop



Joined: 21 Aug 2008
Posts: 8

PostPosted: Mon Aug 03, 2009 1:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group