≡ Menu

Change user password in Windows command line

We can change a user password from Windows command line using net user command. The command is explained below with examples.

How to change local user password

net user  loginid  newpassword

For example, if you want to reset the password for the user John on the local computer, you can run the below command. Let’s say the new password is pq12d*12@

net user  John  pq12d*12@

You may not want to provide the new password in the command prompt for obvious security reasons. Net use command allows to reset the password so that none around your desk can see it. You need to provide * in the place of password while executing net use command. You will be prompted to type the password and the password you enter won’t be printed on the screen. But you need to feed the password twice to make sure that you have entered the password you intended to.

example:

C\>net user John *
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

How to change domain user account password

If you want to change password for a domain account, you can do it by running the below command.

net  user  loginid  *  /domain

Next, you will be prompted twice to enter the password and on successful completion your domain account password will be reset. You can also provide the password in the command itself as explained above.

In case the domain is not reachable then you will get the below error when you try to run the above command.

System error 1355 has occurred.
The specified domain either does not exist or could not be contacted.

Related Posts:

54 comments… add one
  • Dee

    hi on my VISTA computer i get this
    “System error 1355 has occurred.
    The specified domain either does not exist or could not be contacted.”

    • admin

      Make sure that your system can contact the domain controller(DC) machine. see if ‘ping ip-of-DC’ works..
      ex: ping 10.20.30.40

  • Anonymous

    Any command to show the password of a user?

    • Raul

      Nope. Only reset or add password is available via command prompt on windows. Another trick is to reset the password in seconds (such as PassMoz LabWin) and add a new password to the computer so you can know what is the password is.

  • stingray

    when i enter in my case:
    net user Stingray*; to make sure my password isn’t printed on the screen it says “The syntax of the command is: and then it gives me a whole bunch of different options. it doesn’t let me put in a password

    • admin

      you should have whitespace between user name and *. The command should be
      net user stingray *

  • zeromido

    “The user name could not be found.
    More help is available by typing NET HELPMSG 2221.”
    Is this happened because my username contains spaces (example : John’s Family) ?
    What to do ?
    Thanks

    • Friend

      me too, can someone help?

    • Babur

      For spaced usernames e.g. John’s Family, type user name between quotes, for example, “John’s Family”.
      So now the command will be
      net user “John’s Family” *

  • rey

    i have a problem after retyping the new password. It says

    System error 5 has occurred.
    Access is denied.

    pls Help..

    • admin

      Looks like you don’t have admin privileges on the system to change password of another user.

    • Irshad

      right click command prompt and run as administrator.
      or
      select command prompt Ctl+Shift+Enter
      the execute the command.

    • zyakxx

      In this case you have to open the cmd as run administrator and try it again it will happen,

  • peter

    C:\>net user Peter Norton Jr *
    The syntax of this command is:

    NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    C:\>NET USER ASPNET newpassword:*
    System error 5 has occurred.

    Access is denied.

    C:\>NET USER ASPNET newpassword *
    The syntax of this command is:

    NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    this is what i m getting when trying to change password ?
    help please

    • Genuine Dev

      please run cmd as administrator.
      And you can reset password.
      Thanks

  • Iovan Iorgovan

    How can you change the password in command line and also prompt the user to change it at his next login?
    I know for sure this option exists in GUI mode “User must change password at next logon”.

    • Curioususer

      Following;
      Any updates on this query im curious as well tia!

    • sss

      First, use this command:
      wmic UserAccount where Name=’USERNAME’ set PasswordExpires=True

      This will enable password expiration for that user.

      Then, use this:

      net user “USERNAME” /logonpasswordchg:yes

      After that, you’ll want to use the first command again, but this time change it to:
      wmic UserAccount where Name=’USERNAME’ set PasswordExpires=False

      So that your passwords no longer expire.

  • bruce

    net user John pq12d*12@

    This cmd command worked like a charm!
    Thanks

  • Tami

    I’ve tried many times but never get changed successfully comment.

    Net user TST Main VLRIPCITY

    • infXinitive

      Put the user name in quotes if there is a space.

      net user “user name” password

  • Mapopa Ndengu

    This comment goes to those who are having issues with changing passwords for user accounts that have spaces in between (James Clark, for example). The white space in between breaks down the user name into two and affects the syntax structure i.e. net user username password.therefore the line: net user James Clark 12234, is the same as: user James, password: Clark 12234. in which the user James does not exist on the computer. try an underscore between the usernames e.g. net user James_Clark 12234.

    cheers.

    • Dan

      Not underscore, have to place double quotes (“) around arguments with spaces in them.
      C:\net user John Smith *
      becomes…
      C:\net user “John Smith” *

  • gokousahil

    i want to know how to login using cmd with password(i have password) without changing it.

    • Anonymous

      If you have the password then try using the “RUNAS” command
      RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
      /user: program
      ex with username ‘Gabe Itch’: > runas /noprofile /user:”Gabe Itch”\administrator cmd
      You will then be asked to type the password of the given user (so obviously only use it if you know the password of the account you’re trying to run) (Please Note that cmd.exe will not display the password as you type. this is perfectly normal)

  • Melissa

    I receive an error that says the system is not authoritative for the specified account and therefore cannot complete the operation please retry the operation using the provider associated with this account. if this is an online provider please use their providers online site. This is a local account on a Windows 10 computer so I’m a bit confused.

  • oktrik

    the command net user user_name* need to verify for password complexity and this wont work if use script such as php as we need to reenter the password ,instead using net user user_name new_password will change the password without prompt

  • Surbhi Rastogi

    I am not a Domain Admin.
    How can i change my domain user password.

  • Kylito

    Hi ALL
    I have a PC on the domain…but off the network…user cannot login and i recive password reset cause cant login into VPN
    Is it possible to reset domain password via cmd
    or even reset the local password via cmd.
    referring to cmd on automatic repair / advanced troubleshooting screen

  • Luca

    I really need to know how to do that when running INVOKE command, error 5 previleges still.

  • farthan

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

    next what i want to do dns server not authoritative for zone please guide me what i can do for the password reset.

  • Danny Hartfield

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

    I keep getting this message I’m trying to change my password

    • jesus

      that usually means that you made a mistake with the syntax (your computer knows what you are trying to do, but you did it wrong so it’s trying to help you out)

  • Fadyabouelsoud

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

    I keep getting this message I’m trying to change my password

  • reza

    i have a problem please help me .
    when i want to change my password my keyboard does’n work

    • WGS_Shaun

      If you have a keyboard that doesn’t work I would recommend it if you are on Windows 10. Selecting the onscreen keyboard from the accessibility menu at the bottom right of the login screen. You can then log into the computer,
      And Once signed in you can do the following to disable your password
      – win_key + R on the keyboard and run “control userpasswords2” you can select to disable the password on the login screen from there.
      That should work at least till you get a new keyboard.

  • engelbert R ramirez

    NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    username [/TIMES:{times | ALL}]
    I’m getting the same thing. You haven’t replied to these answers, do you not know?

  • Vaish

    I am able to change password/unlock using Active Directory utility but not able change password from command line

    • Srini

      Have you tried with /domain, since this seems to be for a active directory account and not local one.

  • Karim

    How can i do if my username include a point : for example Q.S ?

    • Bjarne Zeb Jørgensen

      use “Q.S”

    • putri

      thanks Bjarne, it works! for those with space between their names and or including [dot], try “[your name]”

  • Mustafe

    Dear, I used my laptop three sign-in options, password, pin, and picture then I forgot the password and the pin. when I try to reset the password via CMD by net user trick it says:
    “NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    username [/TIMES:{times | ALL}]
    username [/ACTIVE: {YES | NO}]”
    and I can’t pass it, can you please help me to get rid this.
    Thanks.

  • shayan

    how do i enter my login is if it is two words? ex: firstname lastname

  • Lani

    I can redo password but it won’t let me type anything.

    • cmd expert

      it is typeing but you can’t se

  • Anonymous

    For those trying to do this with spaces in the user’s name such as John Smith, you need to use quotes, so instead of “net user John Smith *” you need to do “net user “John Smith” *”

  • bill_mcbrayer

    Hi, I’m in cmd line trying to change the password for a local user w/admin priv in Win 8.1.

    Net User: I keep getting: error 5 access is denied. How do I use a net user command to reset pw ………… or what are my other options ? Thx

    Bill
    A+
    VCP 6.0

  • BG

    Srini,
    This is an outstanding site for high quality command-line techniques.
    On my first visit, managed to resolve a difficult problem, and have placed this site on my A-list for other, intermediate and advanced command-line solutions.

    Although this is somewhat off-topic for a command-line site, can you suggest a forum for the common error “Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item” ? All forums and videos presume I have access to Windows controls to change permissions. But I cannot open even Windows File Explorer, not to mention Control Panel in this Windows 7 machine. I can clear passwords and use the hidden administrator account, but still get the error. Your suggestions are appreciated– I’ll check this site tomorrow.

  • Nyasha munyikwa

    How to reset forgotten pc using command prompt without other sofwares

  • Anonymous

    The reason for the “System error 5 – Access is denied” error is because the command syntax is for a password *reset* and not for a password *change*. It’s a really good thing that most people don’t have rights to do password resets on a domain! Otherwise anyone could reset anybody’s domain password without the user’s knowledge or consent.

    A password *change* requires you to know the current password and to input it first (think Change password)

  • Dano

    I was receiving the help response when I entered a username with more that one word C\>net user Jan Smith *
    NET USER
    [username [password | *] [options]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]
    username [/TIMES:{times | ALL}]

    When I put the username in quotes it worked for me:
    C\>net user “Jan Smith” *
    Type a password for the user:
    Retype the password to confirm:
    The command completed successfully.

  • Kiran Bhoir

    Thanks
    Useful commands to change password.

  • Rauno

    Hi i forgot my pc password and i dont want to reset a whoule pc how do i get new password i only have 1 more try and then i need to restart it

Cancel reply

Leave a Comment