Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
PiotrMP006
Posts: 31
Joined: 08 Sep 2017 06:10

Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

#1 Post by PiotrMP006 » 21 May 2024 04:32

Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

Image

Please help

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

#2 Post by miskox » 21 May 2024 04:47

Do this at the command prompt:

Code: Select all

title test
dir
pause
set /p "somestr=enter something:" 
You will see that 'pause' is added to the title or complete 'set /p' command is added to the title. Looks like this is just how 'title' command works - adds a command that stops the processing of the batch file.

Maybe anyone else has a better explanation.

Saso


kwsiebert
Posts: 43
Joined: 20 Jan 2016 15:46

Re: Why does "(title Test) & pause" change the window title to "Test - pause" and not to "Test"?

#4 Post by kwsiebert » 21 May 2024 08:35

It has nothing to do with the title command. The currently executing command is always added to the window title, until it completes, and the pause command is running until you press a key. You can see this by opening a fresh command prompt and executing the pause command by itself.

Post Reply