The Command Prompt Method for Changing Your Username
You can change your Windows username using Command Prompt by running the net user command with administrator privileges. The command syntax is straightforward: net user [current username] /active:yes for set up, or net user [current username] [new username] to rename the account directly. Command Prompt is faster than navigating Settings menus if you know the exact syntax, though it requires you to open the program as an administrator and type the command precisely.
The process differs slightly depending on whether you are changing your own account or another user account on the same computer. If you are changing your own username while logged in, you will need to log out and back in to see the change take effect. If you are changing another user's account, that user does not need to be logged in.
Key Takeaways
- Open Command Prompt as administrator by right-clicking the Command Prompt icon and selecting "Run as administrator".
- Type net user [current username] [new username] and press Enter to rename the account when ready.
- You must log out and log back in to see the new username reflected on your login screen and desktop.
- The command works only for local user accounts, not for Microsoft accounts linked to an email address.
Opening Command Prompt as Administrator
Command Prompt must run with administrator privileges to change a username. Click the Windows Start button, type "Command Prompt" in the search box, and right-click the result labeled "Command Prompt" or "cmd.exe". Select "Run as administrator" from the menu. A dialog box will appear asking "Do you want to allow this app to make changes to your device?" — click "Yes" to proceed.
If you see a User Account Control prompt, you are on the right track. This security step confirms that you have permission to make system-level changes. Once the Command Prompt window opens, you will see a black window with a blinking cursor and a path that typically reads C:\Windows\System32> or similar. You are now ready to type the username change command.
Running the Net User Command to Change Your Username
At the Command Prompt cursor, type the command exactly as shown: net user [current username] [new username]. Replace [current username] with your actual current username and [new username] with what you want it to be. For example, if your current username is "JohnDoe" and you want to change it to "John", you would type: net user JohnDoe John. Press Enter after typing the command.
If the command succeeds, you will see the message "The command completed successfully." If you see an error message instead, the most common causes are a typo in the current username, a username that does not exist on this computer, or Command Prompt not running as administrator. Check that you typed the current username exactly as it appears in your user account settings.
What Happens After You Run the Command
The username change takes effect when ready in the system, but you will not see it on your screen until you log out and log back in. Your user folder location on the hard drive remains unchanged — if your old username was "JohnDoe", the folder will still be called "C:\Users\JohnDoe" even after you change the display name to "John". This is normal and does not cause problems.
When you log out and log back in, your login screen will show the new username, and any shortcuts or file paths that reference your username may display the new name. Programs and files stored in your user folder will continue to work normally. If you have any open files or programs running, save your work before logging out.
Changing Another User's Username on the Same Computer
If you are an administrator and want to change a different user's username, the process is the same. Open Command Prompt as administrator and type net user [their current username] [new username]. That user does not need to be logged in, and the change takes effect when ready. The next time they log in, they will see their new username on the login screen.
You can also view all user accounts on the computer by typing net user with no additional parameters. This will list every local user account, which is helpful if you are not certain of the exact spelling of the username you want to change.
Limitations and When This Method Will Not Work
The net user command works only for local user accounts created directly on your computer. If your account is linked to a Microsoft account (an email address you use to sign in), this command will not change your username. Microsoft accounts are managed through your Microsoft account settings online, not through Command Prompt. You can check whether your account is local or Microsoft-linked by going to Settings > Accounts > Your info — it will show either "Local account" or your email address.
Additionally, you cannot change the username of the built-in Administrator account or the System account using this method. If you are trying to change one of these special accounts, you will receive an error message. For most everyday users with standard local accounts, the Command Prompt method works reliably and quickly.
Troubleshooting Common Errors
If you see "Access denied," Command Prompt is not running as administrator. Close the window and right-click Command Prompt again, making sure to select "Run as administrator" and confirm the User Account Control prompt. If you see "The username does not exist," you have typed the current username incorrectly. Type net user alone to see the exact spelling of all accounts on your computer.
If you see "The password does not meet the password policy requirements," this error is unrelated to username changes and suggests a different command was entered. Double-check that you are typing net user [current username] [new username] with no additional parameters. If the command still fails, try restarting your computer and running Command Prompt as administrator again.
Frequently Asked Questions
Will changing my username affect my files or programs?
No. Your files, programs, and settings remain in place. Your user folder path stays the same even though your display username changes. Programs will continue to work normally because they reference your account by its internal identifier, not by the display name you see on the login screen.
Can I change my username back if I make a mistake?
Yes. Run the same command again with your new username as the current username and your desired username as the new one. For example, if you changed "JohnDoe" to "John" and want to change it back, type net user John JohnDoe. You can change your username as many times as you want.
What is the difference between a local account and a Microsoft account?
A local account is created and stored only on your computer. A Microsoft account is linked to an email address and syncs your settings across devices. You can check which type you have in Settings > Accounts > Your info. The Command Prompt method works only for local accounts.
Do I need to restart my computer after changing my username?
No restart is required, but you do need to log out and log back in. This refreshes your session so the new username appears on your desktop and login screen. straightforward click your profile picture in the Start menu and select "Sign out," then log back in with your password.
Can I use this method on Windows 10 and Windows 11?
Yes. The net user command works the same way on Windows 10, Windows 11, and earlier versions. The steps for opening Command Prompt as administrator are identical across these versions.