Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: How to launch a batch in a separate window, with a batch  (Read 3635 times)

0 Members and 1 Guest are viewing this topic.

PPowerHouseK

  • Guest
How to launch a batch in a separate window, with a batch
« on: October 11, 2009, 09:43:28 AM »
Hello all,

As topic states, I am trying to launch a batch file with another batch.  Here is my predicament, currently I am using the Call function. Call "Server1launch.bat" inside of my servermaintenance.bat. Well, what happens is the first batch sucessfully launches the second, but hangs until the other batch has "completed execution".

Normally this would be ok, except that the batch it launches starts a server and stays opened until the server is shut down, therefore hanging the initial "Servermaintenance.bat"

I have tried start "server1launch.bat", I even converted the batch into an exe in hopes of being able to "start" it. As a last attempt I  created a shortcut and had it "start" the shortcut. In all 3 cases, it opens a new cmd window but only shows the window title, the directory path, then hangs.  It does not attempt to execute the functions inside of the file referred to.

I really need some help on this one guys, its a wrench in my gears. Thanks in advance, I will happily supply more information as needed, if asked nicely.  :)

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: How to launch a batch in a separate window, with a batch
« Reply #1 on: October 11, 2009, 09:53:13 AM »
Try this:

start cmd /c YOURBATCHFILEHERE.BAT

instead of the call command.
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

Salmon Trout

  • Guest
Re: How to launch a batch in a separate window, with a batch
« Reply #2 on: October 11, 2009, 09:54:58 AM »
Use the start command to launch a new instance of %comspec% (usually this expands to C:\WINDOWS\system32\cmd.exe) with the /c switch; study start /? and cmd /? for full details

Code: [Select]
start "" %comspec% /c batch2.bat

PPowerHouseK

  • Guest
Re: How to launch a batch in a separate window, with a batch
« Reply #3 on: October 11, 2009, 10:25:28 AM »
Thanks very much guys, The two of you have solved my problem. I am much obliged. I am sure ill have more questions today..

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: How to launch a batch in a separate window, with a batch
« Reply #4 on: October 11, 2009, 12:27:15 PM »
Thanks very much guys, The two of you have solved my problem. I am much obliged. I am sure ill have more questions today..

Feel free to stick around. If you can help other members out, it will be worth even more to you. You always learn when you teach.
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.