Petri Newsletter Sign-up
Tech Tuesday

Subscribe to Tech Tuesday, the latest insights from for IT Pros.

    See All Petri Newsletters

    Easily Identify Computer Name on Windows 2008 Server Core

    Posted on by Daniel Petri in Windows Server 2008 with 4 Comments

    In Windows Server 2008, one of the installation methods available is server core. A core installation provides a minimal environment for running specific server roles, which reduces the maintenance and management requirements and the attack surface for those server roles. Server core installation does not include the traditional full graphical user interface (GUI). Read more about Server Core on my “Understanding Windows Server 2008 Server Core” article.

    If you are planning to deploy Windows Server 2008 – server core installations in your network I would strongly advise you to use the following tip.

    In all my server core installations I change the default prompt to something like this:

    This customized command prompt will enable you to quickly and easily identify the name of the server you’re currently logged on to. This is quite useful in scenarios where you’ve got many servers connected to one physical monitor, and you switch between the various displays by using a KVS switch. Another usage for this customized command prompt is when you use RDP or Terminal Services to remotely log on to the server, and since all you get is a command prompt window, it’s hard to tell to which server you’re currently connected.

    So, how can you get this cool command prompt? Quite easily, but you do need to edit the server’s registry.


    This document contains instructions for editing the registry. If you make any error while editing the registry, you can potentially cause Windows to fail or be unable to boot, requiring you to reinstall Windows. Edit the registry at your own risk. Always back up the registry before making any changes. If you do not feel comfortable editing the registry, do not attempt these instructions. Instead, seek the help of a trained computer specialist.

    1. On the server core (or any other Windows Server 2008/Vista/2003 computer) open the registry editor by typing REGEDIT.
    2. In the registry navigate to the following key
    3. Look for a key called Prompt, if it’s not there create one using the following settings.
    4. Value Name: Prompt

      Data Type: REG_EXPAND_SZ

      Value Data: $_Server:%computername%$_Username:%username%$_Date:$D$_Time:$T$_$p$g

      By using the above values you get the prompt as shown in the above picture.

      BTW, here are some of the special codes you can use:

      * $A – & (Ampersand) * $B – | (pipe) * $C – ( (Left parenthesis) * $D – Current date * $E – Escape code (ASCII code 27) * $F – ) (Right parenthesis) * $G – > (greater-than sign) * $L – < (less-than sign) * $N – Current drive* $P – Current drive and path * $Q – = (equal sign) * $S – (space) * $T – Current time * $_ – Carriage return and linefeed * $$ – $ (dollar sign)

      Cool! Try this tip on Vista. You’ll love it. Since discovering it I never stop using it, even on my private computers…

      Related Articles

    Recent Windows Server 2008 Forum threads

    Got a question? Post it on our Windows Server 2008 forums!


    Don't have a login but want to join the conversation? Sign up for a Petri Account


    Register for this Petri Webinar!

    Want to Make Your Backup Storage Unlimited & Ready for the Cloud? – Free Thurrott Premium Account with Webinar Registration!

    Tuesday, August 27, 2019 @ 1:00 pm EDT

    A Scale-Out Backup storage infrastructure is a must-have technology for your backups. In this webinar, join expert Rick Vanover for a look on what real-world problems are solved by the Scale-Out Backup Repository.

    Register Now

    Sponsored By