Hello,
I need help with writing a script that run with a "loop" or "wait" and checking if cmd.exe process is running,
if the process is running, then do nothing,
when the process is stops and not running anymore, then popup a msgbox: "cmd process not running anymore".
Tnx!
loop to process
Re: loop to process
I have done this and need more help with the code please.
Code: Select all
loop
{
IfWinNotExist, ahk_exe cmd.exe
msgbox,64,,cmd process not running anymore
}
Re: loop to process
Your code works, but it's better to use WinWaitClose than IfWinNotExist in this case so it doesn't continuously loop while waiting for it to close.
Re: loop to process
Tnx,
but I had to start the loop after the IfWinNotExist:
but I had to start the loop after the IfWinNotExist:
Code: Select all
loop
IfWinNotExist, ahk_exe cmd.exe
{
msgbox,64,,cmd.exe process not running
break
}
Re: loop to process
It's still looping continuously while waiting for it to close, where it wouldn't do that if you use WinWaitClose instead (and put it in the loop). I haven't checked, but I would think your version uses a lot more CPU time.
Who is online
Users browsing this forum: Google [Bot], inseption86, jaka1, mebelantikjaya and 316 guests