windows - How to run commands on another cmd -


i want run commands on 2 cmds while opening same file, if open .bat file opens 2 cmd , run 2 differents commands (1 each). it's possible that?

if got right want do, note it's batch file:

@echo off start cmd /c "echo 1st command && pause" start cmd /c "echo 2nd command && pause" 

read cmd here , start here. following switches of cmd command can considered:

/c: carries out command specified string , stops.
/k: carries out command specified string , continues.

instead of using /k used /c pause command show concatenation of 2 commands here.

to concate 2 commands use commanda && commandb described here @ ss64 great site when comes batch scripting:

commanda && commandb: run commanda, if succeeds run commandb


as requested example cd, dir , pause like:

@echo off start cmd /c "cd c:\users\ && dir && pause" start cmd /c "cd c:\ && dir && pause" 

it changes directory, prints directory list , wait use input.


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -