How do you wait for an exe to complete in batch file?
I'm trying to create a script to execute an exe on shutdown in order to install sp1. my script goes something like (not actual bat script).
If installed GOTO END
Install.exe
END:
My problem is that when it runs, it starts the installer, then finishes the script because the installer's a different process and follows up by shutting down the install process because the computer's shutting down and shutting down the system (at least, that's what i think it's doing.)
Is there any way to tell it to wait until the process it started completes and then shutdown?
Try running
START /WAIT Install.exe
One shorter way:
Install.exe|more
Also
install|rem
could be used , though with more eventually you'll be able to catch some console output. And this is the reason it works - the piped command waits for input until the .exe is finished