agbnielsen
asked on
Command to wait for process to finish before proceeding
Hi,
I am looking for something similar to the 'start /wait' DOS command without 'start'.
I am writing up a batch file that calls on a prepackaged .exe (for an AV installation) with 'start /wait' and that works fine. The package then automatically calls on another process that connects to the Internet and downloads a whole heap of files (around 100MB worth).
I want the batch script to wait until this process is completed before proceeding, but seeing as the process is automatically starts the update process 'start /wait' will not work.
Any help would be appreciated.
I am looking for something similar to the 'start /wait' DOS command without 'start'.
I am writing up a batch file that calls on a prepackaged .exe (for an AV installation) with 'start /wait' and that works fine. The package then automatically calls on another process that connects to the Internet and downloads a whole heap of files (around 100MB worth).
I want the batch script to wait until this process is completed before proceeding, but seeing as the process is automatically starts the update process 'start /wait' will not work.
Any help would be appreciated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try using "call" in a batch file
call file1.exe
call file2.exe
call file1.exe
call file2.exe
ASKER
Hi,
I found the following command that does what I want it to:
tasklist | find "process.exe" > nul:
IF NOT errorlevel 1 goto wait
echo "Antivirus successfully updated"
Thanks for the replies guys.
I found the following command that does what I want it to:
tasklist | find "process.exe" > nul:
IF NOT errorlevel 1 goto wait
echo "Antivirus successfully updated"
Thanks for the replies guys.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If that is the case, then is there something that the download process does when it's done, like update a log file, or delete a temp file or something?
Or is it a single windows process that we could search for in a process list, and wait until it stops running?
~bp