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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Ranguna173
Posts: 104
Joined: 28 Jul 2011 17:32

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

#1 Post by Ranguna173 » 18 Sep 2011 13:19

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!!

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

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

#2 Post by !k » 18 Sep 2011 13:27

Code: Select all

start %ComSpec% /c "batch_2.cmd"

Ranguna173
Posts: 104
Joined: 28 Jul 2011 17:32

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

#3 Post by Ranguna173 » 18 Sep 2011 13:52

!k wrote:

Code: Select all

start %ComSpec% /c "batch_2.cmd"


Thank You, again!

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

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

#4 Post by dbenham » 18 Sep 2011 14:07

What is the advantage of using %comspec% /c :?:

Why not simply

Code: Select all

start batch2.cmd


Dave Benham

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

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

#5 Post by !k » 18 Sep 2011 14:30

Code: Select all

start batch2.cmd

New window will not close after batch2.cmd end

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

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

#6 Post by dbenham » 18 Sep 2011 15:49

Good to know - thanks

Dave

Ranguna173
Posts: 104
Joined: 28 Jul 2011 17:32

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

#7 Post by Ranguna173 » 19 Sep 2011 01:02

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!

Post Reply