Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running exe files sequentially using bat file

14,243 views
Skip to first unread message

sekh...@gmail.com

unread,
May 27, 2013, 8:05:42 AM5/27/13
to
Iam trying to run a bat file using the below code.

start /wait "D:|Silent_installer.bat"
start /wait 'D: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.

any suggestions would be of great help

foxidrive

unread,
May 27, 2013, 8:22:10 AM5/27/13
to
On 27/05/2013 22:05, sekh...@gmail.com wrote:
> Iam trying to run a bat file using the below code.
>
> start /wait "D:|Silent_installer.bat"
> start /wait 'D:def.bat"
>

Try this:

start "" /wait "D:|Silent_installer.bat"
start "" /wait 'D:def.bat"



--
foxi

sekh...@gmail.com

unread,
May 27, 2013, 8:39:50 AM5/27/13
to
On Monday, May 27, 2013 5:52:10 PM UTC+5:30, foxidrive wrote:
> On 27/05/2013 22:05, sekh...@gmail.com wrote: > Iam trying to run a bat file using the below code. > > start /wait "D:|Silent_installer.bat" > start /wait 'D:def.bat" > Try this: start "" /wait "D:|Silent_installer.bat" start "" /wait 'D:def.bat" -- foxi

Hello ....

Thanks .I tried it but with no luck.

both bat files ate executing at the same time.

Is there any alternative for this?

foxidrive

unread,
May 27, 2013, 9:02:35 AM5/27/13
to
On 27/05/2013 22:39, sekh...@gmail.com wrote:
> On Monday, May 27, 2013 5:52:10 PM UTC+5:30, foxidrive wrote:
>> On 27/05/2013 22:05, sekh...@gmail.com wrote: > Iam trying to run a bat file using the below code.
>> > > start /wait "D:|Silent_installer.bat" > start /wait 'D:def.bat" > Try this:
>
> Hello ....
>
> Thanks .I tried it but with no luck.
>
> both bat files ate executing at the same time.

You had a typo.

start "" /wait "D:\Silent_installer.bat"
start "" /wait "D:\def.bat"


If the batch file starts multi-threaded programs then they will return before completing.

Then the command itself needs a start "" /wait



--
foxi

Konrad Kullig

unread,
May 27, 2013, 10:43:05 AM5/27/13
to
Why not simply

call "D:\Silent_installer.bat"
call "D:\def.bat"

?
Regards
Konrad


<sekh...@gmail.com> schrieb im Newsbeitrag
news:af0936da-3956-45a3...@googlegroups.com...

Todd Vargo

unread,
May 27, 2013, 4:35:45 PM5/27/13
to
It should be working with all typos corrected, however batch files do
not need START/WAIT to run them sequentially. CALL is all that is
needed. Type CALL/? at prompt.

CALL D:\Silent_installer.bat
CALL D:\def.bat

If you still have items loading at the same time, then you need to look
in those batch files for any lines using START to run executables within
those batch files without a /WAIT switch. If you are still having
problems with this, post the contents of those batch files and explain
where the problem is.

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)

sekh...@gmail.com

unread,
May 28, 2013, 1:03:50 AM5/28/13
to
On Monday, May 27, 2013 5:35:42 PM UTC+5:30, sekh...@gmail.com wrote:
> Iam trying to run a bat file using the below code. start /wait "D:|Silent_installer.bat" start /wait 'D: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. any suggestions would be of great help

I tried

If i use start ""/wait abc.bat and start ""/wait def.bat ,the abc scripti is executing and def.exe wll never start

If i use call abc.bat and call def.bat both both exe are executing simultaneously which is not my requirement.

is anything iam missing to put in between?

foxidrive

unread,
May 28, 2013, 5:14:55 AM5/28/13
to
The OP repeated the question on Stack Overflow, complete with the wrong syntax in the lines above.



--
foxi

sekh...@gmail.com

unread,
May 28, 2013, 5:53:02 AM5/28/13
to
On Tuesday, May 28, 2013 2:44:55 PM UTC+5:30, foxidrive wrote:
> On 28/05/2013 06:35, Todd Vargo wrote: > On 5/27/2013 8:05 AM, sekh...@gmail.com wrote: >> Iam trying to run a bat file using the below code. >> >> start /wait "D:|Silent_installer.bat" >> start /wait 'D: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. >> >> any suggestions would be of great help >> > > It should be working with all typos corrected, however batch files do > not need START/WAIT to run them sequentially. CALL is all that is > needed. Type CALL/? at prompt. > > CALL D:\Silent_installer.bat > CALL D:\def.bat > > If you still have items loading at the same time, then you need to look > in those batch files for any lines using START to run executables within > those batch files without a /WAIT switch. If you are still having > problems with this, post the contents of those batch files and explain > where the problem is. The OP repeated the question on Stack Overflow, complete with the wrong syntax in the lines above. -- foxi

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 ?

foxidrive

unread,
May 28, 2013, 6:09:39 AM5/28/13
to
On 28/05/2013 19:53, sekh...@gmail.com wrote:
>
> 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 ?
>

Call this Runme.bat and you only need one batch file.



@echo off
start "" /wait D:\Setp.exe
D:\ISR.exe



But I suspect you have more than one command in each batch file - we are only guessing because we don't
have a complete picture.



--
foxi

sekh...@gmail.com

unread,
May 28, 2013, 6:30:02 AM5/28/13
to
On Monday, May 27, 2013 5:35:42 PM UTC+5:30, sekh...@gmail.com wrote:
> Iam trying to run a bat file using the below code. start /wait "D:|Silent_installer.bat" start /wait 'D: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. any suggestions would be of great help

Hello ,thanks

Yes i have more command lines in each bat file.
Please refer below
abc.bat file contains
\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\Disk1\setup.exe !quiet=\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\silentinstall-SPB.ini


and def.bat file contains

\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\Hotfix_SPB16.50.038_wint_1of1.exe !quiet=\\in0114srv01\ElecCAD\AutoITpackaging\silent.ini



now please suggest the code?

foxidrive

unread,
May 28, 2013, 6:41:07 AM5/28/13
to
You have one command in each bat file? What you have shown is only one command in each.

You can put both lines in one batch file.

@echo off

start "" /wait "\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\Disk1\setup.exe"
!quiet=\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\silentinstall-SPB.ini


start "" /wait
"\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\Hotfix_SPB16.50.038_wint_1of1.exe"
!quiet=\\in0114srv01\ElecCAD\AutoITpackaging\silent.ini



--
foxi

foxidrive

unread,
May 28, 2013, 6:43:35 AM5/28/13
to
On 28/05/2013 20:30, sekh...@gmail.com wrote:
You have one command in each bat file? What you have shown is only one command in each.

You can put both lines in one batch file.

@echo off

start "" /wait "\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\Disk1\setup.exe" !quiet=\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\silentinstall-SPB.ini


start "" /wait
"\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\Hotfix_SPB16.50.038_wint_1of1.exe" !quiet=\\in0114srv01\ElecCAD\AutoITpackaging\silent.ini

--
foxi

foxidrive

unread,
May 28, 2013, 6:45:02 AM5/28/13
to
On 28/05/2013 20:30, sekh...@gmail.com wrote:
You have one command in each bat file? What you have shown is only one command in each.

You can put both lines in one batch file.

This post has the lines unwrapped. Try this.


@echo off

start "" /wait "\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\Disk1\setup.exe" !quiet=\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\BASE_SPB165\silentinstall-SPB.ini


start "" /wait "\\in0114srv01\ElecCAD\ADW165_Installables\ADW165_KIT2_STSI\Hotfix_SPB16.50.038_wint_1of1.exe" !quiet=\\in0114srv01\ElecCAD\AutoITpackaging\silent.ini

--
foxi

sekh...@gmail.com

unread,
May 28, 2013, 7:04:22 AM5/28/13
to
On Monday, May 27, 2013 5:35:42 PM UTC+5:30, sekh...@gmail.com wrote:
> Iam trying to run a bat file using the below code. start /wait "D:|Silent_installer.bat" start /wait 'D: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. any suggestions would be of great help

Hello ,thanks

I tried it but no luck.

both exe files starts executing at the same time.also i can see the same in task manager.
is there anything i cantry?

foxidrive

unread,
May 28, 2013, 7:13:41 AM5/28/13
to
On 28/05/2013 21:04, sekh...@gmail.com wrote:
> Hello ,thanks
>
> I tried it but no luck.
>
> both exe files starts executing at the same time.also i can see the same in task manager.
> is there anything i cantry?

If the exe files adhere to Windows standards then they will wait. I can't see your machine or what you
have in the batch file to see if there is more than the two lines.

You have said there are just two commands but we can't be sure.


Run this batch file and close each top window in turn. This is how it is meant to work.

@echo off
start "" /wait notepad.exe
start "" /wait calc.exe
start "" /wait colorcpl.exe
start "" /wait notepad.exe





--
foxi

Todd Vargo

unread,
May 28, 2013, 7:27:42 AM5/28/13
to
Taking a guess, setp.exe could be an installer that expands its payload
to a temp folder and then passes of control to the real installer in a
separate process.

Todd Vargo

unread,
May 28, 2013, 7:32:46 AM5/28/13
to
This proves OP knows how to copy/paste, just not the actual code. My
take is, if both batches are running at the same time, then there must
be correct syntax some where otherwise neither batch would run at all.

donthid...@gmail.com

unread,
Dec 29, 2013, 6:59:23 AM12/29/13
to
in my small brain have one little thing.
check this.

start /w cmd /k call "filepath\installer.bat"
start /w cmd /k call "filePath\def.bat"


remove comma's

foxidrive

unread,
Dec 29, 2013, 7:10:28 AM12/29/13
to
I removed the commas.
0 new messages