You cannot change your Windows username from Command Prompt alone

Command Prompt can show you your current username with a single command, but it cannot change it. Windows usernames are tied to your system settings and user account, which require either the Settings app or Control Panel to modify. Command Prompt is a text-based tool for running commands and scripts — it does not have access to the account management features needed to rename a user.

If you want to change your username, you have two straightforward paths: use Settings (faster on Windows 10) or use Control Panel (older method, still works). Both take about five minutes. Command Prompt's role is limited to showing you what your current username is, which is useful if you need to confirm it before making changes elsewhere.

Key Takeaways

  • Your Windows username is stored in system account settings, not in Command Prompt, so you must use Settings or Control Panel to change it.
  • You can view your current username in Command Prompt by typing whoami and pressing Enter, which displays the full path including your computer name.
  • The Settings app method (Settings > Accounts > Your info > Rename your PC) is the fastest way to change your username on Windows 10.
  • Control Panel offers an alternative route through User Accounts if Settings does not work or you prefer the older interface.
  • You must be logged in as an administrator to change a username, and the change takes effect the next time you log in.

How to find your current username in Command Prompt

Open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter. At the prompt, type whoami and press Enter. The output will show your username in the format COMPUTERNAME\username. The part after the backslash is your actual username.

If you want just the username without the computer name, type whoami /user and press Enter. This displays your username along with your security identifier (SID), a unique number Windows assigns to every account. Neither of these commands changes anything — they only display information.

Changing your username through Settings

Press the Windows key and type Settings, then press Enter. Click Accounts in the left sidebar. Click Your info at the top. You will see your current account name displayed. Click the Rename your PC button.

A dialog box will appear with your current username highlighted. Delete it and type your new username. Click Next, then Finish. Windows will ask you to restart your computer. Save any open work, click Restart now, and your new username will be active after you log back in.

This method changes the display name and the folder name in C:\Users\. If you have files saved in your old username folder, Windows will update the path automatically, so your documents and downloads remain accessible.

Changing your username through Control Panel

Press the Windows key and type Control Panel, then press Enter. Click User Accounts (or User Accounts and Family Safety if you see that option). Click User AccountsManage another account if you are changing someone else's account, or Change your account name if you are changing your own.

Select the account you want to rename. Click Change the account name. Type your new username in the text box and click Rename. Restart your computer for the change to take effect. This method works the same way as Settings but uses the older Control Panel interface.

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

When you rename your account through Settings or Control Panel, Windows updates your user profile folder from C:\Users\oldname\ to C:\Users\newname\. Your Documents, Downloads, Desktop, and other personal folders move with the account automatically. Programs that store settings in your user folder will find them in the new location.

Some older programs may still reference your old username in their settings or shortcuts. If a program stops working after you rename your account, you can usually fix it by updating the program's shortcut or reinstalling it. Your files themselves are never lost — only the folder path changes.

Why you might see different usernames in different places

Windows distinguishes between your account name (what you log in with) and your display name (what appears on the Start menu and lock screen). When you change your username through Settings, you are changing both. However, some programs may show your old username if they cached it before the change, or if they reference your SID instead of your account name.

If you see your old username in a program after renaming your account, restart that program or restart your computer. If the old name persists, the program may need to be reinstalled or updated. This is rare, but it happens with programs that store user information in their own databases rather than reading it from Windows.

Troubleshooting if you cannot change your username

If the Rename button is grayed out or you get an error message, you may not have administrator rights on your account. Ask the person who manages your computer to change your username, or contact your IT department if this is a work computer. Some workplaces lock usernames to prevent changes.

If you are on a work or school network, your username may be managed by a domain administrator rather than your local computer. In that case, you will need to contact your IT support team to request a username change. Command Prompt will still show your current username with the whoami command, but the Settings and Control Panel methods will not work.

Frequently Asked Questions

Can I change my username without restarting my computer?

No. Windows requires a restart to explore the username change to all system files and running processes. You can make the change and choose to restart later, but the new username will not be active until you log out and back in.

Will changing my username affect my password?

No. Your password remains the same. You log in with your new username but use the same password you used before. If you want to change your password as well, you can do that separately through Settings > Accounts > Sign-in options > Password.

What if I change my username and then want to change it back?

You can change it back the same way you changed it the first time. Go to Settings > Accounts > Your info > Rename your PC, type your old username, and restart. Windows will move your user folder back to the original name.

Does the whoami command work on older versions of Windows?

Yes. The whoami command works on Windows 7, Windows 8, and Windows 10. The Settings method for changing your username is specific to Windows 10, but Control Panel works on all versions.

Can I use Command Prompt to change someone else's username?

No. Command Prompt cannot change usernames at all. You would need to use Settings or Control Panel on that person's account, and you would need administrator rights. If you manage multiple accounts on one computer, you can change each one through Settings by selecting the account first.