TITLE

Change the title text displayed across the top of the CMD terminal window.

Syntax 
      TITLE [string]

Key
   string   The title for the command prompt window, up to 243 characters.

The TITLE command is typically used in a batch file to give the script window a meaningful name.

The default title for the CMD shell is %comspec% however, since the title can be re-defined in a program shortcut, the title is typically set to "Command Prompt".

If you start a second CMD shell, or PowerShell, this will be added to the Title, when you EXIT back to the initial shell, the Title will also revert making it possible to track how many nested shells you have open.

The START command, used to start a program in a separate window also has an option to specify a title for the new Window.

If you call a batch script in a new CMD session, then any TITLE set within the batch file will revert when the second CMD session ends.

  TITLE Some initial title text
  CMD /c MyBatchFile.cmd
  ...

TITLE is an internal command.

Examples

Set a title for the current session:

C:\> title Remember, all I’m offering is the truth. Nothing more

Set the default %comspec% title:

C:\> title %comspec%

In a batch file, set the title to match the name of the batch file with:

@Echo off
TITLE %~nx0

"The longer the title, the less important the job" ~ George McGovern.

Related commands

MODE - change the size of the CMD window.
COLOR - change the colour of the CMD window.
PROMPT - change the CMD window prompt.
START - start a program in a separate window.
Max length of the TITLE command - SS64 forum.
QuickEdit mode - also changes the title (temporarily).
Equivalent PowerShell: Set the console title to current working dir (save in Profile.ps1 to make permanent).


 
Copyright © 1999-2024 SS64.com
Some rights reserved