InterviewSolution
Saved Bookmarks
| 1. |
Solve : How to launch a batch in a separate window, with a batch? |
|
Answer» 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. Try this: start cmd /c YOURBATCHFILEHERE.BAT instead of the call COMMAND. 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.batThanks very much guys, The two of you have solved my problem. I am much OBLIGED. I am sure ILL have more questions today.. Quote from: PPowerHouseK 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..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. |
|