Why doesn't the following code change the color and the title on cmd2? How, and what to do? The command changes color on cmd1, and sets the title on cmd2?
start cmd.exe /k TITLE TEST & color 02 & mode con: cols=160 lines=78
Why doesn't the following code change the color and the title on cmd2? How, and what to do? The command changes color on cmd1, and sets the title on cmd2?
start cmd.exe /k TITLE TEST & color 02 & mode con: cols=160 lines=78
Without quoting the command that the new
cmd
instance must execute, the&
is interpreted as a command concatenation after thestart
and so it is executed in the first instance. With quotes, it is part of the command to execute in the secondcmd
instance.Also, as the
start
command sees the first quoted argument as the tile of the window to start, and we are going to use quotes, it is necessary to include a title in the command (or""
for no title).