Page 1 of 1
how to wait for a process to close before run another comman
Posted: 21 May 2011 05:10
by Huidong
I tried to run Malwarebytes update, wait for it to close, and then run a scan. Both execute the same mbam.exe with parameters /update and /scan, resp. I wonder how to wait for the first instance to end before running the second command. Thanks you!
Re: how to wait for a process to close before run another comman
Posted: 21 May 2011 05:22
by Huidong
I noticed
run command, [directory], [wait=0]
, trying...
Re: how to wait for a process to close before run another comman
Posted: 21 May 2011 05:30
by Huidong
no, using run ..., 1 does not work, the second command is run before the first instance is closed. Help please.
Re: how to wait for a process to close before run another comman
Posted: 21 May 2011 05:35
by Huidong
It works to some extent:
Code: Select all
"Update and Quick scan"
run """C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"" /update -silent", 1;
msg "Update is done!";
run """C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"" /scan -quick -terminate"
But I still have to press OK in response to the stupid message. Is there a way to avoid this?
Thanks!
Re: how to wait for a process to close before run another comman
Posted: 21 May 2011 05:46
by Huidong
I was being careless.
Code: Select all
"Update and Quick scan"
run """C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"" /update -silent", , 1;
run """C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"" /scan -quick -terminate"
This works! The following is wrong!
Code: Select all
run """C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"" /update -silent", 1;