Posts: 276
Threads: 34
Joined: Dec 2016
I want to run two programs: A.exe and B.exe
1. First run A.exe,
2. When the process of A program disappears, and then run B.exe
How to write code that waits for the A process to disappear? Any suggestions and comments are welcome, thanks in advance
Macro
Macro2
run "$desktop$\A.exe"
?????? how to write?
run "$desktop$\B.exe"
Posts: 276
Threads: 34
Joined: Dec 2016
If the A program is notepad, I can use the code below
But the A program is a macro (. Exe), not window! how to write it?
Macro
Macro1
run "notepad"
wait(0 WP win("notepad" "Notepad"))
run "$desktop$\B.exe"
Posts: 276
Threads: 34
Joined: Dec 2016
I have tested the following, failed, I hope someone can help me, thank you very much :oops:
Macro
Macro1
run "$desktop$\A.exe"
wait 0 WP win("" "A")
run "$desktop$\B.exe"
Posts: 135
Threads: 33
Joined: Aug 2009
Macro
Macro595
run "notepad.exe"
;
;try to close Notepad
rep
,if !ProcessNameToId("notepad.exe")
,,break
,0.1
out "Notepad is not here![]run ''B.exe''"
;run "B.exe"
Regards.
Posts: 12,073
Threads: 140
Joined: Dec 2002
QM exe processes have a hidden window. You can see it in QM dialog "Explore windows". That window can be used to wait or to end the process.
Posts: 276
Threads: 34
Joined: Dec 2016
Thank you very much, has been successful
Posts: 276
Threads: 34
Joined: Dec 2016
Suggest:
In the Wait for dialog box, add an option, such as the picture below
or:
Add a built-in command such as runwait
In autohotkey, the realization of this function is very simple, only need to use the runwait command on it