TechBuzzPro

How to Change Your Password in Windows 11 with Command

· 4 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can change your Windows 11 password using the command line with the net user command. This method works for local accounts and, with proper domain access, for domain accounts. It’s especially useful for administrators managing multiple accounts or users comfortable with Command Prompt. Before using this method, ensure you have administrator privileges and know the current password if prompted.

What You'll Need

  • Administrator access to the Windows 11 device
  • Current password (if changing your own password)
  • Command Prompt opened with administrator privileges
  • Target username (if changing another user’s password)

Step-by-Step

  1. Press Windows + S to open search, type cmd, then right-click Command Prompt and select Run as administrator. If prompted by User Account Control, click Yes.
  2. In the Command Prompt window, type net user and press Enter. This displays a list of all user accounts on the system. Note the exact username you want to change.
  3. To change your own password, type net user [username] *, replacing [username] with your actual username (e.g., net user John *). The asterisk (*) prompts you to enter a new password securely.
  4. Press Enter. You will be prompted to enter a new password. Type it and press Enter.
  5. You’ll be asked to confirm the new password. Re-enter it exactly and press Enter.
  6. If the command completes without an error message, the password has been updated. You can verify by typing net user [username] and checking the “Password last set” field.
  7. For changing another user’s password (only as administrator), type net user [username] [newpassword], replacing both placeholders. This skips the prompt and sets the password directly. Example: net user Sarah P@ssw0rd2024.
  8. Press Enter. If successful, no message appears. If access is denied, ensure you’re running Command Prompt as administrator.
  9. Close Command Prompt when finished.

Common Mistakes

  • Forgetting to run Command Prompt as administrator: Without admin rights, the net user command will fail with “System error 5” (access denied).
  • Typing the wrong username: Usernames are case-sensitive in some contexts. Double-check the exact spelling shown in the net user list.
  • Using special characters without quotes: If your password contains characters like &, <, or >, wrap the entire command in quotes: "net user John P@ss&word".
  • Not confirming the new password correctly: When using *, you must type the new password twice. A mismatch results in no change.
  • Changing another user’s password without authority: Only administrators should do this. Unauthorized changes violate policy and may lock users out.

Tips

  • Use the * method when setting your own password to avoid exposing it in command history.
  • After changing a password, test it by logging out and back in.
  • For domain accounts, this command only works if you have domain admin rights and are connected to the domain controller.
  • Consider enabling password hints via Settings > Accounts > Sign-in options if users forget passwords frequently.
  • Use strong passwords: at least 12 characters, mixing uppercase, lowercase, numbers, and symbols.

Troubleshooting

If the password change fails, follow these steps in order:

  1. Restart Command Prompt as administrator: Close and reopen it using “Run as administrator” to ensure proper permissions.
  2. Check spelling: Re-run net user to confirm the exact username. Typos are common.
  3. Verify account type: Microsoft accounts cannot be changed this way. The net user command only affects local accounts. To change a Microsoft account password, go to account.microsoft.com.
  4. Check for group policy restrictions: In managed environments (schools, workplaces), group policies may prevent local password changes. Contact IT support if this is the case.
  5. Ensure the account is not disabled: Run net user [username] to check if the account status is “Active: Yes”. If not, enable it with wmic useraccount where name='[username]' enable=true.
  6. Try Safe Mode with Command Prompt: If the system is locked or unresponsive, boot into Safe Mode and attempt the change there.
  7. Use Settings app as fallback: Press Windows + I, go to Accounts > Sign-in options, and change the password there if command line fails.

Frequently Asked Questions

Can I change a Microsoft account password with net user?

No. The net user command only works for local accounts. Microsoft accounts require online password changes at account.microsoft.com.

Do I need the old password to change it via command line?

If changing your own password using *, yes. If you’re an administrator changing another user’s password, no.

Why do I get “System error 5”?

This means “Access is denied.” You must run Command Prompt as administrator to use net user for password changes.

Can I change the password remotely via command line?

Only if you have remote command execution enabled (e.g., via PowerShell Remoting or Remote Desktop) and administrator access to the target machine.

Is this method safe?

Yes, if used correctly. Avoid typing passwords directly in commands (use * instead) to prevent them from being stored in command history.

What if I forget the administrator password?

If no other admin account exists, you may need a password reset disk or reinstall Windows. Some tools exist for recovery, but only use official methods to avoid data loss or security risks.