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: runcommanda, if succeeds runcommandb
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
Post a Comment