Hi guys,
I am quite new to AHK and I would like to ask for help .
How can I set within AHK to wait until process within cmd.exe will proceed?
example:
I do have a script which will split *.xsl file to *.txt files. This will take variable amount of time (depending on size of the input from *.xls).
Cmd will proceed with splitting and after it will finish it will wait for additional action(s).
How can I set within script to check if the cmd already finished or not?
I hope I made myself clear
Thanks for help
cmd.exe+autohotkey
Started by
defila
, Oct 01 2012 10:01 AM
8 replies to this topic
#1
-
Posted 01 October 2012 - 10:01 AM
:?:Runs an external program and waits until it finishes.
Source: http://www.autohotke...ommands/Run.htm
#2
-
Posted 01 October 2012 - 11:07 AM
:?:Runs an external program and waits until it finishes.
Source: http://www.autohotke...ommands/Run.htm
Thanks for reply ,
anyway, the executable files are simple *.bat files and the AHK does have a problem to run them, it will create an error log everytime, that the script is missing in *System32 folder (even if it is in place) and will stop with execution (this won't happen if the *bat file is run "manually").
However, I do not want to run it like this (I do not want to force every user to go to the folder and run each *.bat files) I just want to create a simple *.exe *. ahk script which will do every task instead of them ...
any suggestion?
#3
-
Posted 01 October 2012 - 11:24 AM
What is in these BAT files, chances are it is easy to translate it to a RunWait command using proper directory parameters.
#4
-
Posted 01 October 2012 - 11:43 AM
AHK file :
BAT file :
This will run the bat, wait for it to finish (e.i. press a key) then display the MsgBox as it should...
I suspect your bat files suck.
RunWait Test.bat Msgbox OK
BAT file :
@echo TOTO @pause
This will run the bat, wait for it to finish (e.i. press a key) then display the MsgBox as it should...
I suspect your bat files suck.
#5
-
Posted 01 October 2012 - 02:07 PM
AHK file :
RunWait Test.bat Msgbox OK
BAT file :@echo TOTO @pause
This will run the bat, wait for it to finish (e.i. press a key) then display the MsgBox as it should...
I suspect your bat files suck.
Yes, they do suck, because they are used to help end-user to do something automatically : )) (much better solution than to force anyone to do smthg through cmd)
Files will create a table for him and run selected program (which is working through Win GUI but not through AHK command)
the issue is not within the *bat or scripts because I know they are working and I am still looking for solution which should be done to check commands which ended within cmd
(I am quite not sure why it is impossible to run these *bat(s) via autohotkey and the error log is present ) ...
#6
-
Posted 01 October 2012 - 02:41 PM
Try searching for "cmdret". That may be relevant.
#7
-
Posted 01 October 2012 - 02:49 PM
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Antonio França -- git.io -- github.com -- ahk4.net -- sites.google.com -- ahkscript.org
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
I find it hard to believe you can't run a bat from AutoHotkey. Are you sure you sent the working dir in the Run command?
RunWait, Target [, WorkingDir, Max|Min|Hide|UseErrorLevel, OutputVarPID]
#8
-
Posted 01 October 2012 - 03:00 PM
hi guys,
I have solved it, I have re-written *.bat and add loop which checked if the window was active or not
anyway thanks for guiding me to the *.bat(s)
I have solved it, I have re-written *.bat and add loop which checked if the window was active or not
anyway thanks for guiding me to the *.bat(s)
#9
-
Posted 05 October 2012 - 01:30 PM