5

How would I change the password of Windows 7 using the command prompt if the existing password isn't known, but I have admin rights?

2
  • 2
    Obligatory reminder: resetting your password (as opposed to changing it) will render anything encrypted using your Windows credentials unrecoverable. This includes things like files encrypted using EFS.
    – CBHacking
    Sep 30, 2015 at 4:35
  • @CBHacking Does the net user approach "reset" or "change" the password? Or what did you mean with that comment?
    – ygoe
    Sep 7, 2016 at 15:02

4 Answers 4

6

Type this command net user (your username) * Then type new password, and confirm it. You are done. See the image. In the image zack is my username. When you type the password the command prompt won't show the cursor moving as you type. Just type new password and press enter.

enter image description here

1

Use the "net user" command.

C:\>net user /?
The syntax of this command is:

NET USER
[username [password | *] [options]] [/DOMAIN]
         username {password | *} /ADD [options] [/DOMAIN]
         username [/DELETE] [/DOMAIN]
         username [/TIMES:{times | ALL}]


C:\>

See also here: http://technet.microsoft.com/en-us/library/8935e4a8-3624-46a1-b47a-c7735802b456
and here http://support.microsoft.com/kb/251394

1

Yes you could change the password with net user <username> <newpassword>.

Here further informations.

0

Some examples

Changing the password

There are two ways of changing the password in Command Prompt:

  1. The silent way

Net User "User's name" "New password"

  1. The Interactive way

Net User "User's name" *

Here asterisk (*) prompts the user for password input making it invisible on the screen and unrecordable in Command Prompt's (cmd.exe) history.

Notes

  • Always double quote the name and the password to escape special characters such as spaces.
  • The current user's name is contained withing %UserName% environment variable.
  • Windows is case-insensitive operating-system hence letter cases do not matter in variable names; meaning %USERNAME% and %username%, and even %uSErNaMe% gives the same result.
  • The above is true for Windows commands (their names) as well, meaning net, Net, and NET all are same.

Making the user administrator

To make a user administrator you should add the user into the Administrators group what is done as follows in command-line "style":

Net LocalGroup Administrators "User's name" /Add

Activating the system's Administrator user

Windows has a special user named Administrator who is deactivated by default and who you call when you Run an executable file as Administrator. That user can be activated to login with as follows (in CLI style):

Net User Administrator /Active:Yes

It might be called the "ultimate" user which you can login without creating a separate user, but it's not recommended. Furthermore, it ignores UAC and the related, and has troubles with things such as the new metro interface and its tiles, by default, without reconfiguration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .