I'm trying to start a command prompt via a batch file, echo some text, and change the title of the command prompt. I'm trying:
start cmd
/k echo This is a terminal
/k title TerminalThe echo text displays, but not the title text.
4 Answers
The TITLE command works for me.
start cmd
TITLE Test
PAUSEEdit: I believe the syntax for /k is
cmd /k "TITLE Test" Silly me, I've found what I needed.
Doing
start "title here"will do a title for the wanted program. From there, it is just
start "Terminal" cmd /k echo This is a terminalIf you want to run multiple echos / other commands, do
start "Terminal" cmd /k "echo this is one echo command & echo this is another"where you separate each command input with &
You could use the following:
start cmd /k "echo this is a terminal & title Terminal"The ampersand allows you to put multiple commands on one command line - see Command shell overview.
I recommend using start "Terminal Name Here" C:\Windows\system32\cmd.exe because it only opens 1 window while start "Terminal" cmd /k echo This is a terminal will keep opening windows over and over again until it is forced to stop IF you name it cmd.cmd or cmd.bat.