Start a Command Prompt and then change the title of it via batch file?

2

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 Terminal

The echo text displays, but not the title text.

13steinj

Posted 2015-07-24T20:30:46.013

Reputation: 21

Answers

3

The TITLE command works for me.

start cmd
TITLE Test
PAUSE

Edit: I believe the syntax for /k is

cmd /k "TITLE Test"

MC10

Posted 2015-07-24T20:30:46.013

Reputation: 7 590

0

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.

moonpoint

Posted 2015-07-24T20:30:46.013

Reputation: 4 432

0

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 terminal

If 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 &

13steinj

Posted 2015-07-24T20:30:46.013

Reputation: 21

2-1 Even after you correct yourself, your quotes are a mess and wrong, Try start "Terminal" cmd /k echo This is a terminal or start "Terminal" "cmd /k echo This is a terminal" – barlop – 2015-07-24T21:12:08.307

@barlop whoops your right. edited. – 13steinj – 2015-07-25T03:43:59.957