Page 1 of 1

[Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 13:19
by Ranguna173
Hi, again!

I have another question:

If I have two batch files:
batch_1
batch_2

And I want to open batch_2 with batch_1 in a new window.

I've used:

Code: Select all

"batch_2"


But that code opens the "batch_2" in the same windows as "batch_1"

Pleas help!
Thx!!

Re: [Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 13:27
by !k

Code: Select all

start %ComSpec% /c "batch_2.cmd"

Re: [Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 13:52
by Ranguna173
!k wrote:

Code: Select all

start %ComSpec% /c "batch_2.cmd"


Thank You, again!

Re: [Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 14:07
by dbenham
What is the advantage of using %comspec% /c :?:

Why not simply

Code: Select all

start batch2.cmd


Dave Benham

Re: [Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 14:30
by !k

Code: Select all

start batch2.cmd

New window will not close after batch2.cmd end

Re: [Question] Opening Batch files in a new window with cmd

Posted: 18 Sep 2011 15:49
by dbenham
Good to know - thanks

Dave

Re: [Question] Opening Batch files in a new window with cmd

Posted: 19 Sep 2011 01:02
by Ranguna173
dbenham wrote:What is the advantage of using %comspec% /c :?:

Why not simply

Code: Select all

start batch2.cmd


Dave Benham


Yeah, I used that too but as !k said
!k wrote:New window will not close after batch2.cmd end


Thanks!