sekharece
Experts, I am trying to run a bat file using the below.
start /wait "abc.bat"
start /wait "def.bat"
It's happening like both bat files running at the same time.
But I wanted the first bat file to run completely then def.bat should start. The first bat file takes approx 60 min and inbetween second bat file starting.Ideally I wanted the first batch to complete 100% then second bat file should start.
I also used call like below but no luck
call "abc.bat"
call "def.bat"
Any suggestions would be of great help
additonal info: both bat files invokes exe files and each bat file run approx 60 min for the installation.
abc.bat invokes base exe file and def.exe invokes service pack installation.
----------------------------
#2 28 May 2013 10:24
foxidrive
You have to use start "" /wait inside your abc.bat file. One of the programs in there is multi-threaded and lets the batch file continue.
----------------------------
#3 28 May 2013 10:29
sekharece
Hello,Thanks for your info.But if i add start "" /wait in abc.bat what is happening is that after installing abc.bat ,def.bat will never start.
i tried adding start "" /wait in both abc.bat and def.bat but no luck.same result
----------------------------
#4 28 May 2013 10:52
sekharece
i just confused ,you mean this way ..
"abc.bat"
"def.bat"
and inside abc.bat
start "" /wait D:\Setp.exe
and inside def.bat
D:\ISR.exe
Please suggest ?
----------------------------
#5 28 May 2013 12:36
bluesxman
From your last post, I'm not sure why you have the abc.bat and def.bat files at all.
Also, I have found in the past that some setup programs launch a secondary process, which can break the "/wait" function. It sounds like you might be having that problem. I would check after launching "setp.exe" whether the process is still active in Task Manager (I suspect you'll see something else has kicked off).
Try this in a single .bat file:
Code: Select all
start /wait "" "D:\Setp.exe"
pause
start /wait "" "D:\ISR.exe"
Last edited by bluesxman (28 May 2013 12:37)
cmd | *sh | ruby | chef
----------------------------
#6 22 Jul 2013 20:15
daezor2001
You could try to do something like this:
Code: Select all
Rem Executing batch files
start /B mybat1.bat
ping 127.0.0.1 n 1 > nul
start /B mybat2.bat
ping 127.0.0.1 n 6 > nul
If you need execute a program with priority or affinity, you must set up, for example: start /high /affinity 2 /B mybat.bat
Sometimes, it's necessary to specify the path where your batch file is located.
So, try:
Code: Select all
Rem Executing my bacth file
cd c:\(your path)
start /high /affinity 2 /b mybat.bat
Note: setting up affinity you can assign which core's processor might run with the executable file.