Programming Field

Title - DOS/Command Prompt Reference

[Windows NT series] Sets the title of the prompt window.

Syntax

title [<title>]
<title>
Specifies the string to be displayed in the title bar. Double quotation marks (" ") are not ignored.
If this specification is omitted, nothing will happen. However, if there is a single space after the ‘title’ command, an empty string will be set (for the console host program; nothing will happen in the case of Windows Terminal).

Details

Usage of Title

Changes made using the Title command persist for the duration of that session (until the window is closed). For example, if you used Title to change the title name within a batch file, executing that batch file directly from the Command Prompt window will retain the changed title even after the batch file ends (Setlocal command won't revert it either). If you want to keep the title change within the batch file, you can either run the batch file from Explorer or explicitly use the Cmd program by executing it as ‘cmd /c <batch file>’.

Samples

Sample

title Hello, world

Sets the title to ‘Hello, world’.