Josh P
Josh P

Reputation: 61

How to use a .bat file to run other .bat(s) and have each one in a seperate cmd prompt in different directory locations

    start cmd
    cd /d C:\U\O\D\L\D\M
    call runbot.bat
    cd /d C:\U\O\D\L\F
    call RunBossBot.bat

My issue is switching between cmd windows, it attempts to put everything in one window. Grateful for any help, Thanks

Upvotes: 0

Views: 273

Answers (1)

user6017774
user6017774

Reputation:

start "" "c:\somewhere\runbot.bat"
start "" "c:\somewhere\RunBossBot.bat"

Starting a Program

See start /? and call /? for help on all three ways.

Specify a program name

c:\windows\notepad.exe

In a batch file the batch will wait for the program to exit. When typed the command prompt does not wait for graphical programs to exit.

If the program is a batch file control is transferred and the rest of the calling batch file is not executed.

Use Start command

start "" c:\windows\notepad.exe

Start starts a program and does not wait. Console programs start in a new window. Using the /b switch forces console programs into the same window, which negates the main purpose of Start.

Start uses the Windows graphical shell - same as typing in WinKey + R (Run dialog). Try

start shell:cache

Use Call command

Call is used to start batch files and wait for them to exit and continue the current batch file.

Upvotes: 1

Related Questions