Link to home
Start Free TrialLog in
Avatar of agbnielsen
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.
Avatar of Bill Prew
Bill Prew

So are you saying the packaged module that you called with START /WAIT returns to the BAT script as soon as it spawns the internet download process, and doesn't wait for it to finish?

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
SOLUTION
Avatar of mayday175
mayday175
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try using "call" in a batch file
call file1.exe
call file2.exe
Avatar of agbnielsen

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.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial