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
You can run two commands in one line in Windows Command Prompt. For that, you need to create a batch script file using Notepad. Below, we have shared the two best methods to run multiple commands in CMD on Windows 10 computers. Let's check out.
Updated: 12/31/2020 by Computer Hope. Alternatively referred to as Cmd+K, Command+K is a keyboard shortcut that varies depending on the program used. For example, in certain programs, Command+K is used to insert a hyperlink, and in some browsers, Command+K focuses on the search bar.
start "TEST" 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 the start
and so it is executed in the first instance. With quotes, it is part of the command to execute in the second cmd
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With