Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

/WAIT not working correctly

doodledump

Programmer
Joined
Sep 4, 2024
Messages
7
I'm trying to create a batch script that requires running two programs, one after the other. I've tried using wait to make the script run in sequence but it plows through the first wait and only stops at the second. This is the problem section:

::Uninstalls old build
@echo Uninstalling previous build...
start "Build Uninstall" /d "path" /WAIT program
@echo Uninstalled build

::Installs newest build
@echo Installing new build...
for /f %%f in ('dir path /O: D/T:W /B ') do @set "file=%%f"
@echo Newest build: %file%
start "Build Install" /d "path" /WAIT %file%
@echo Build installed

Any advice is appreciated, I'm working on a Windows Server 2019 Standard
 
Ah alright. I was hoping it was an error on my part. I still really need this batch file to wait for the first program to finish before running the second but I'll look into other ways to pause the script.
 

Part and Inventory Search

Sponsor

Back
Top