Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to write code that waits for the A process to disappear
#1
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
Code:
Copy      Help
run "$desktop$\A.exe"

?????? how to write?

run "$desktop$\B.exe"
#2
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
Code:
Copy      Help
run "notepad"

wait(0 WP win("notepad" "Notepad"))

run "$desktop$\B.exe"
#3
I have tested the following, failed, I hope someone can help me, thank you very much :oops:


Macro Macro1
Code:
Copy      Help
run "$desktop$\A.exe"

wait 0 WP win("" "A")

run "$desktop$\B.exe"
#4
Macro Macro595
Code:
Copy      Help
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.
#5
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.
#6
Thank you very much, has been successful Smile
#7
Suggest:
In the Wait for dialog box, add an option, such as the picture below Tongue

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


Attached Files Image(s)
   


Forum Jump:


Users browsing this thread: 1 Guest(s)