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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -