What changing your Command Prompt username actually does

Changing your Command Prompt username changes the name that appears in the command line prompt itself — the text that shows before you type each command. On most Windows computers, this is your Windows account name by default. When you change it, you are changing what the prompt displays, not your actual Windows login credentials or email address.

The prompt normally looks like this: C:\Users\YourName>. After you change the username setting, it might look like C:\Users\WorkStation1> or whatever name you choose. This is purely a display change. Your Windows account, files, and permissions stay exactly the same.

Most people change their Command Prompt username for clarity in shared environments, to match a workstation name instead of a person's name, or to simplify a long or complicated account name when running scripts or batch files.

Key Takeaways

  • The Command Prompt username is set by the PROMPT environment variable, which you can change through System Properties or by typing a command directly into Command Prompt.
  • Changing the prompt display does not change your Windows account name, password, or file permissions — only what appears on screen.
  • The quickest temporary change is typing set PROMPT=$P$G into Command Prompt, but this only lasts until you close the window.
  • To make the change permanent, you must edit the PROMPT variable in Environment Variables through System Properties, which affects all future Command Prompt windows.
  • If you want to display something other than your account name, you can use special codes like $P for the path, $D for the date, or custom text.

The temporary method: change the prompt for one session

If you only need to change what appears in Command Prompt for the current session, you can type a command directly. Open Command Prompt and type set PROMPT=$P$G, then press Enter. This resets the prompt to show only the current path and a greater-than symbol (like C:\Users\YourName>). When you close Command Prompt, the change disappears.

You can also replace the default prompt with custom text. Type set PROMPT=YourCustomName$G and press Enter, replacing "YourCustomName" with whatever you want to see. For example, set PROMPT=WORKSTATION1$G makes the prompt display WORKSTATION1>. Again, this only lasts for that one Command Prompt window.

This method is useful for testing or for one-off tasks, but it does not persist. Every new Command Prompt window you open will show the original prompt until you type the command again.

The permanent method: edit the environment variable

To change your Command Prompt username for all future windows, you need to edit the PROMPT environment variable in Windows. Right-click the Start button and select System. On the right side of the window, click Advanced system settings. This opens the System Properties dialog.

In System Properties, click the Environment Variables button near the bottom. A new window opens showing two lists: User variables and System variables. Look for a variable named PROMPT in either list. If it does not exist, you will create it. Click New under the User variables section (the top list).

In the New User Variable dialog, type PROMPT in the Variable name field. In the Variable value field, type what you want the prompt to display. Use $P$G to show the current path and a greater-than symbol, or type custom text followed by $G. For example, entering ADMIN$G makes every prompt show ADMIN>. Click OK, then OK again to close Environment Variables, then OK once more to close System Properties.

You must close and reopen Command Prompt for the change to take effect. Any new Command Prompt window you open will now display your new prompt.

Common prompt codes and what they display

The PROMPT variable accepts special codes that insert information automatically. $P displays the current directory path. $G displays a greater-than symbol (>). $D shows the current date. $T shows the current time. $N displays the current drive letter. $_ creates a line break, moving the next part of the prompt to a new line.

You can combine these codes with custom text. For example, WORKSTATION1 $P$G displays WORKSTATION1 C:\Users\YourName>. The code $D$_$T$_$P$G creates a multi-line prompt showing the date, time, and path on separate lines. Experiment with different combinations to find what works best for your workflow.

Reverting to the default prompt

If you changed the PROMPT variable and want to go back to the default, you have two options. The simplest is to delete the PROMPT variable entirely. Open Environment Variables again (right-click Start, select System, then click Advanced system settings, then Environment Variables). Find PROMPT in the User variables list, select it, and click Delete. Click OK and close all windows. New Command Prompt windows will show the default prompt.

Alternatively, you can set PROMPT to its Windows default value by entering $P$G in the Variable value field. This produces the same result as the default prompt. Close and reopen Command Prompt to see the change.

Why your change might not appear

If you edited the PROMPT variable but Command Prompt still shows the old prompt, you probably did not close and reopen Command Prompt after making the change. Environment variable changes only take effect in new windows, not in windows that were already open. Close all Command Prompt windows completely, then open a new one.

If you are using Command Prompt as Administrator, you may need to edit the System variables list instead of the User variables list. Try adding the PROMPT variable to System variables if it does not work in User variables. Some corporate networks also lock environment variables through group policy, which prevents changes from taking effect — contact your IT department if you work in that environment.

Frequently Asked Questions

Does changing the Command Prompt username change my Windows login name?

No. The Command Prompt username is only what displays on screen in the prompt. Your actual Windows account name, password, and login credentials do not change. Your files and permissions remain exactly the same.

Can I make the prompt show something completely different, like a custom company name?

Yes. You can type any text you want in the PROMPT variable. For example, setting PROMPT to MYCOMPANY$G makes every prompt display MYCOMPANY>. You can also combine custom text with codes like $P (path) and $D (date) to create more complex prompts.

Will changing the prompt affect scripts or batch files I run?

No. Scripts and batch files do not read or depend on what the prompt displays. Changing the prompt is purely visual and does not affect how commands execute or how programs behave.

What if I set the PROMPT variable but it does not work?

Make sure you closed all Command Prompt windows and opened a new one after making the change. Environment variables only load when a new window starts. If you are still having trouble, check that you typed PROMPT exactly (all capitals) in the Variable name field, and that you used the correct codes like $P and $G in the Variable value field.

Can I have a different prompt in PowerShell?

PowerShell uses a different system called the prompt function, not the PROMPT environment variable. To change the PowerShell prompt, you edit your PowerShell profile file, which is a separate process from changing Command Prompt. Command Prompt and PowerShell prompts are independent.