You cannot change your Windows username from Command Prompt itself

Command Prompt is a text interface for running system commands, but Windows username changes require either the Settings app, Control Panel, or administrator-level commands that affect the entire system account — not just the Command Prompt display. If you want to change how your name appears in Command Prompt, you have two separate paths: change your actual Windows username (which affects everything on your computer), or change only the name that shows in the Command Prompt window.

The confusion usually happens because Command Prompt displays your username in the prompt line — the text that appears before you type each command. That display pulls from your Windows account name. Changing one means changing the other, unless you use a workaround specific to the Command Prompt window itself.

Key Takeaways

  • Your Windows username and your Command Prompt display name are linked; changing your Windows account name changes both.
  • To change your actual Windows username, use Settings (easiest) or Control Panel, and your computer will restart.
  • To change only what appears in the Command Prompt window without changing your Windows account, you can rename the user profile folder using administrator commands.
  • Renaming your user profile folder requires Command Prompt running as administrator and a restart, and can affect where programs look for your files.
  • If you are locked out or cannot restart, the safest option is to contact your system administrator or Microsoft Support.

Change your Windows username through Settings (Windows 10 and 11)

Open Settings by pressing Windows key + I, then go to Accounts on the left side. Click Your info at the top. You will see your current account name displayed. Click the Rename your account button, type your new name, and click Next. Windows will ask you to confirm; click Finish and your computer will restart.

This method changes your Windows account name everywhere — in Command Prompt, File Explorer, login screen, and all other places where your username appears. The change takes effect after restart. If you have files saved in your user folder (usually C:\Users\[YourName]), Windows will update the path automatically, though some older programs may not find them when ready.

Change your Windows username through Control Panel (older Windows versions)

If you are using Windows 7 or an older system, open Control Panel and go to User Accounts. Click Manage another account or Change your account name depending on your version. Select your account, click Change the account name, type the new name, and click Rename. Your computer will restart.

The process is similar to Settings but the interface looks different. Control Panel is also still available in Windows 10 and 11 if you prefer it — search for "Control Panel" in the Start menu, then navigate to User Accounts and Change your account name.

Rename your user profile folder using Command Prompt (advanced)

If you want to change the folder name in C:\Users\ without using Settings, you can do this through Command Prompt, but it requires several steps and administrator access. Open Command Prompt as administrator by right-clicking the Command Prompt icon and selecting Run as administrator. Type whoami and press Enter to see your current username.

To rename the folder, you must log in with a different administrator account or use Safe Mode, because Windows will not let you rename a folder while you are logged in with that account. Restart your computer, press F8 during startup (or access Safe Mode through Settings on Windows 10/11), log in with a different admin account, open Command Prompt as administrator, and type ren C:\Users\[OldName] [NewName]. Replace [OldName] with your current username and [NewName] with what you want it to be. Press Enter, then restart and log back in with your account.

This method changes only the folder name, not your account name in Settings. Some programs may still look for your old folder path and fail to find your files. Use this only if you understand the risk or have a specific reason to keep your account name different from your folder name.

What happens to your files and programs when you change your username

When you change your Windows username through Settings or Control Panel, your user folder path stays the same — Windows updates it behind the scenes. Your documents, downloads, desktop, and program settings remain accessible. Programs that store data in your user folder will find it without any action from you.

If you rename only the folder using Command Prompt, programs may not find your old files because they still look in the old path. You would need to manually move files or update program settings. This is why the Settings method is safer for most people — it handles the update automatically.

Troubleshooting: What to do if the change does not work

If you changed your username but Command Prompt still shows the old name, restart your computer. The change does not take effect until after a restart. If the old name persists after restart, open Command Prompt and type whoami to see what Windows actually recognizes. If that shows the new name but Command Prompt displays the old one, close and reopen Command Prompt.

If you cannot restart because a program is running or you are locked out of your account, save your work and restart anyway — holding the power button for 10 seconds forces a shutdown. If you are locked out entirely, you may need to use another administrator account to restart, or contact your IT department if this is a work computer.

Frequently Asked Questions

Will changing my username affect my passwords or login?

No. Your password stays the same. You log in with the same password; only the name displayed changes. If you use a Microsoft account (not a local account), your password is tied to your email, not your username, so changing the display name does not affect login at all.

Can I change my username without restarting?

Not through Settings or Control Panel — both require a restart. If you rename the folder through Command Prompt, you also need a restart because Windows locks the folder while you are logged in. There is no way to change your username without restarting.

What if I change my username and my programs stop working?

Restart your computer first — most programs update their paths automatically after restart. If a program still fails, it may be looking for your old folder path. Reinstalling the program usually fixes this. If you renamed only the folder (not through Settings), you can rename it back to the original name and try again.

Can I have two different usernames on the same computer?

Yes — you can create multiple user accounts in Settings under Accounts and Other people. Each account has its own username, files, and settings. When you restart, you can choose which account to log into. This is different from changing your username; you would be creating a separate account instead.

Is it safe to change my username?

Yes, if you use Settings or Control Panel. Windows handles the file path update automatically. Renaming the folder through Command Prompt is riskier because programs may not find your files afterward. If you are not sure, use Settings — it is the safest method.