TITLE command in Windows: label your terminals and track script progress

The TITLE command changes the title bar text of a Command Prompt window. You probably already know that. But there is more to it — dynamic status updates during script execution, multi-window orchestration with START, and a few non-obvious behaviors worth knowing before you use it in production scripts.

Quick answer

TITLE Your label here

What TITLE does

TITLE sets the text displayed in the title bar of the current CMD window. It affects only the active session and resets when the window closes. The change is immediate — no restart required.

Syntax:

TITLE [string]

The string can include spaces, numbers, and most printable characters. Maximum length is 243 characters. TITLE is a CMD built-in and does not work natively in PowerShell — see the equivalent at the end of this article.

Practical examples

1. Know which step your script is on without switching windows

The problem: You launch a long batch script and minimize the window. A few minutes later you have no idea if it is still running, stuck, or already done — unless you click on it and interrupt your focus.

The solution: Update the title bar at each step. It stays visible in the taskbar the whole time.

Save this as C:\bat\deploy-demo.bat and run it:

@echo off
:: Step 1 - update the title so the taskbar shows current progress
TITLE Deploy demo - Step 1/3: Collecting system info
echo Collecting system info...
hostname
whoami
:: pause 2 seconds to simulate work - remove in real scripts
timeout /t 2 /nobreak >nul
:: Step 2 - title updates again before the next task starts
TITLE Deploy demo - Step 2/3: Checking network
echo Checking network...
ipconfig | findstr "IPv4"
timeout /t 2 /nobreak >nul
:: Step 3 - one more update before the final task
TITLE Deploy demo - Step 3/3: Listing running services
echo Listing running services...
sc query type= all state= running | findstr "SERVICE_NAME"
timeout /t 2 /nobreak >nul
:: Final update - script is done
TITLE Deploy demo - Done
echo.
echo All steps complete. Press any key to exit.
pause >nul

While this script runs, minimize the window. The taskbar shows exactly where it is:

Taskbar: [Deploy demo - Step 1/3: Collecting system info]
         [Deploy demo - Step 2/3: Checking network]
         [Deploy demo - Step 3/3: Listing running services]
         [Deploy demo - Done]

2. Tell multiple CMD windows apart at a glance

The problem: You open three CMD windows — one watching processes, one checking network, one pinging a host. They all show the same default title. One minute later you cannot tell which is which without clicking each one.

The solution: Label each window at launch using START. Save this as C:\bat\multi-monitor.bat and run it:

@echo off
:: START opens a new CMD window
:: The first quoted argument sets the window title immediately at launch
:: /k keeps the window open after the command finishes
:: Window 1 - shows currently running processes
START "Task Watcher" cmd /k "TITLE Tasks - Running processes & tasklist /fi "STATUS eq RUNNING""
:: Window 2 - shows network adapter details
START "Net Info" cmd /k "TITLE Net - Interface info & ipconfig /all"
:: Window 3 - continuously pings loopback to confirm network stack is alive
START "Ping Health" cmd /k "TITLE Net - Ping loopback & ping -t 127.0.0.1"

Three windows open. Each is labeled before a single line of output appears:

Taskbar: [Tasks - Running processes]
         [Net - Interface info]
         [Net - Ping loopback]

3. Make a script self-identify on any machine

The problem: You maintain the same maintenance script on 20 machines. When you connect via RDP and see a CMD window open, you cannot tell which machine it belongs to without reading the output — especially when multiple RDP sessions are open at the same time.

The solution: Use built-in environment variables in the title. The window identifies itself automatically on every machine it runs on.

Run directly in any CMD window to test:

TITLE %COMPUTERNAME% - %USERNAME% - Maintenance

The title bar immediately shows the current machine and user — no hardcoding needed:

Taskbar: [DESKTOP-7KF92A - john - Maintenance]

For a full script, save this as C:\bat\maintenance.bat:

@echo off
:: %COMPUTERNAME% expands to the machine name automatically
:: %USERNAME% expands to the currently logged-in user
:: %DATE% adds the date so you know when this session started
TITLE %COMPUTERNAME% - %USERNAME% - Maintenance started %DATE%
echo Running maintenance tasks on %COMPUTERNAME%...
echo.
:: Show free disk space on C: drive
echo Checking disk space on C:
dir C:\ /-c 2>nul | findstr "bytes free"
echo.
:: Update the title when work is done
TITLE %COMPUTERNAME% - %USERNAME% - Maintenance complete
echo Done. Press any key to close.
pause >nul

Expected output on any machine:

Running maintenance tasks on DESKTOP-7KF92A...
Checking disk space on C:
               54,217,318,400 bytes free
Done. Press any key to close.

4. Protect a long-running script from being closed by mistake

The problem: A backup or data migration script is running in a CMD window on a shared workstation. A colleague sees an unfamiliar terminal, assumes it is abandoned, and closes it — killing the operation halfway through.

The solution: Put a visible warning directly in the title bar so anyone who sees the window knows not to touch it.

Save this as C:\bat\backup-demo.bat:

@echo off
:: Warning in the title bar - visible even when the window is minimized
:: %TIME% records when the backup started
TITLE Backup running - DO NOT CLOSE - Started %TIME%
echo Starting backup...
echo.
:: Simulating file copy with a loop - replace with your actual xcopy or robocopy command
for /l %%i in (1,1,5) do (
    echo Copying file %%i of 5...
    :: timeout simulates the time a real file copy would take
    timeout /t 1 /nobreak >nul
)
:: Update the title once work is finished - include finish time for reference
TITLE Backup complete - Finished %TIME%
echo.
echo Backup finished. Press any key to close.
pause >nul

Expected output:

Starting backup...
Copying file 1 of 5...
Copying file 2 of 5...
Copying file 3 of 5...
Copying file 4 of 5...
Copying file 5 of 5...
Backup finished. Press any key to close.

Title bar during and after:

[Backup running - DO NOT CLOSE - Started 14:23:05.18]
                    ↓
[Backup complete - Finished 14:23:10.44]

Hidden gems

START’s first argument and TITLE are not the same thing. When you write START "My Label" cmd /k ..., that quoted string sets the window title instantly at launch — before cmd.exe even loads. The TITLE command inside runs only after the shell starts. Scripts that skip the first argument get an unlabeled flash in the taskbar before their TITLE line executes.

Special characters need escaping. The characters &, >, <, and | are interpreted by CMD as operators, not text. Escape them with ^:

TITLE Status ^& Running

Title bar result:

[Status & Running]
Warning: Without ^, CMD reads & as a command separator and silently breaks the line. The title will be set to whatever comes before the &, with no error message.

TITLE with no argument sets a blank title — not the default. Running TITLE alone clears the title bar completely. To restore something sensible:

TITLE %COMSPEC%

Title bar result:

[C:\Windows\System32\cmd.exe]
Note: %COMSPEC% expands to the full path of the current command interpreter. On a standard Windows installation this is C:\Windows\System32\cmd.exe.

PowerShell equivalent

TITLE is a CMD built-in and has no effect in PowerShell sessions. Use this instead:

$host.UI.RawUI.WindowTitle = "Deploy Script - Running"

To update it during a script:

$host.UI.RawUI.WindowTitle = "Step 1/3 - Collecting system info"
Get-ComputerInfo | Select-Object CsName, OsVersion
$host.UI.RawUI.WindowTitle = "Step 2/3 - Checking network"
Get-NetIPAddress | Where-Object AddressFamily -eq "IPv4" | Select-Object IPAddress
$host.UI.RawUI.WindowTitle = "Done"
Write-Host "All steps complete."

Where this matters

RDP sessions — when connected to multiple servers simultaneously, labeled CMD windows make it immediately clear which window belongs to which machine.

Shared workstations — a title like Backup running - DO NOT CLOSE prevents accidental termination by colleagues working in the same session.

Task Scheduler jobs — scripts running overnight update their title as they progress. When you log in the next morning, the final title reflects the last completed step.

Multi-step deployments — title updates act as a lightweight progress indicator visible in the taskbar without needing a separate monitoring window.


Tips and limitations

  • TITLE affects only the current CMD session and does not persist after the window closes
  • TITLE produces no output and no error message — if it silently does nothing, check for unescaped special characters in the string
Note: In Windows Terminal, the tab name may override TITLE depending on profile settings. If labels are not appearing, check the terminal profile configuration — look for the Tab title option and clear it to allow the command to take effect.

Official documentation

TITLE — Windows Commands | Microsoft Learn


Related guides