Freigeben über


Setting the Title of the Command Prompt Window

I was wondering how you change the title of the Command Prompt window.  A little searching found that Scott Hanselman had answered this question here.  All you have to do is type "title <your text>" and press Enter to change the title of your Command Prompt window.  It should look like the following:

Note that if you are running Console2 to host your command prompt window, it works just fine.

Finally, if you want to do the same thing in PowerShell, just execute the following command:

[System.Console]::Title = "Running as User12345"

Note that you have to have the quotes around the text to which the title should be set; they may be single or double quotes.

Rob

Comments

  • Anonymous
    August 21, 2012
    Did you hear about ConEmu? www.hanselman.com/.../ConEmuTheWindowsTerminalConsolePromptWeveBeenWaitingFor.aspx And there was similar question about changing tab title: superuser.com/.../139371 ConEmu's solution is using ANSI X3.64 escape sequences. But title will work too.

  • Anonymous
    August 25, 2012
    I think you sold me, @Maximus.  I just downloaded it and started playing with it.  Beautiful so far.  Thanks for sharing!

  • Anonymous
    October 01, 2014
    I realize this was around for a few years now, but I just needed this and found your post. We often need windows running ping checks, and putting a title helps differentiate which is which. This is quick and easy. Thanks.

  • Anonymous
    July 07, 2015
    Stilluseful in 2015 - thanks!

  • Anonymous
    November 22, 2015
    Do you know how to do it permanently?

  • Anonymous
    January 04, 2016
    Thanks for this mate.

  • Anonymous
    January 09, 2016
    Good solution, but I have a question: is there a way to keep the window unchangeable? The moment we run a console program , TSM, it overwrites the window title name. Something I could put in start.bat: cd <path> title <name of the instance> Do_something_to_keep_window_unchanged <name of the appliccation> I am using Windows Server 2008 R2 Enterprise

  • Anonymous
    May 26, 2016
    hey...If you want to permanently change the title, you need to open the command prompt from a short cut (from your taskbar, desktop, etc). Right click on your cmd.exe shortcut and select properties. Under Shortcut tab, Target should read something like "%windir%\system32\cmd.exe"Simply modify Target to: %windir%\system32\cmd.exe /K "title YOUR_TITLE_HERE"Make sure the "title" command is in quotes. Now anytime you open that shortcut, the Title will be changed. Hope this helps.

  • Anonymous
    October 27, 2016
    nice example, its resolved my issue with in 10seconds