Skip to content →

HOWTO: Change your XP password via the command line

I submitted this quick tip to Lifehacker in the past. If you feel the need to change your Windows password, you don’t need to go through any Control Panel menus and whatnot. You can change any user’s password via the command line, as long as you have administrative access. A good example of when to use this tip would be after a fresh install of XP. One of the first things you should do is lo into the default Administrator account and set a password. That requires booting into Safe Mode as Administrator, setting a password, then booting back into Normal mode as your own user. Instead, go to Start > Run > “cmd” [Enter], then enter:

net user <username> <password>

netuser1.jpg

This will set the password you supplied as the password for the user you entered. You can also do:

net user <username> *

netuser2.jpg

This will prompt you for a password, then have you confirm it.
NOTE: you need administrator access to change the password via this command. However, if you are an administrator, you can change the password for any account on the machine. As you can see, this is a very powerful command, but it can also pose as a security threat.

Published in security time savers windows

59 Comments

  1. Roman Roman

    What is point of changing a password when you are an admin. tried to do as guest.

  2. Mark Mark

    Roman,
    You obviously did not read the first paragraph of this article.

    A good example of when to use this tip would be after a fresh install of XP. One of the first things you should do is lo into the default Administrator account and set a password. That requires booting into Safe Mode as Administrator, setting a password, then booting back into Normal mode as your own user.

    Does that answer your question?

  3. Miguel Miguel

    Man thank you. I used this to take the password off of safemode administrator which had a password on it.

  4. narayan narayan

    I tried these commands sucessfully works

  5. Is there any way to change the password while using guest account?

  6. Mark Mark

    shahbaz,

    I have not come across a method for changing the password in a Guest account. Good luck finding one.

  7. Rastlin Rastlin

    What about if u cant enter any key into commandline after u use the command : net user administrator *

    systemerror 5

  8. Dinesh Dinesh

    Ultimate Idea..Its work..dinesh patil

  9. its not ganna be work……………..coz error in the msg.. in cmd promt.

  10. Fan wen Fan wen

    This do not work with XCP in a domain

    do you have another solution ?

  11. Mark Mark

    I don’t think you can because the Domain Controller handles that. Sorry.

  12. Logan Logan

    if you are an administrator of the domain run it like this

    “net user * /DOMAIN”

    that will make it process on the domain controller

  13. Hi Fri,
    This is not work if u use guest account.It can work with admin acc.
    And u also use ‘user account” to do like this.

  14. This command work well. I have tested. But what about the security issue associated with. The hacker can take advantage of this tiny command bye opening hidden command prompt. Do you know anything about this..

    Thanks

  15. mehmet mehmet

    Hi,

    I am restricted user on mu pc at work. some small programs I can install but I can’t install any Adawere and other malware finding softwares into my computer . beacuse of not having priviligies but how can I change my user type or hack Windows XP admin password..

  16. G0J0G0 G0J0G0

    I have a computer that my sister’s company “out-grew” and she doesn’t have the O/S (XP NT)disk and can’t remember the user name and pass code. (She gave me and my other sister one and had this info on hers). Anyhow I can’t get past the log-on screen that asks for the user name and pass code. Is there any way around this? I have tried to log in in safe mode and the same user name and pass code log in box appears. HELP in AL.

  17. tom tom

    how to hack “windows xp sp2” admin password from guest account.
    explain how finding the password not changing the password.

  18. Mark Mark

    1. You cannot just find the password, it can only be changed.
    2. You can only change the password using this method if you have admin rights.

  19. freeze freeze

    how can i hack my window xp admin password easily

  20. ar kur ar kur

    hi sheildtox, can i be your friends,
    please give me your e-mail

  21. great information you have…i have tested it…it really works.

  22. How do u enter the usrnm? all i get is “username not found.” and im using ym own usrnm!!

  23. pramod pramod

    is there any fast trick to change xp & vista password without login.

  24. joker joker

    if u r limited acount, you can not find like this =(

  25. vignesh vignesh

    Plz give me a solution for this.
    I want to remove the local admin Password .

  26. ORLOCK ORLOCK

    The only way to change the password on an XP machine without having access is to find a program called ERD commander from winternals… this lets you log in on a temporary GUI and then using the locksmith program you can change the forgotten password. good luck to all!

  27. mohit mohit

    sir,
    i have lost my admin account in winxp
    but a limited account working properly,
    so how can i recover my admin password

    mohit

  28. helo guys! my brother has set administrator password and gave me a guest account der s any idea 2 open the administrator account from guest account?????????????/plz help me

  29. i want to install a program but then change the admin password back to what it origianally was but i dont know it.
    do you have a hack that can help solve my problem?

  30. admin_idiot admin_idiot

    Bought fingerprint reader, set it up to login with. All was good.
    Thought something was up and someone had my admin PW so I changed it.
    Because I was using the damn finger print reader after 3 mo I forgot what I changed the admin PW to. I was still able to login using the finger print reader but I could not login by typing in my PW. Crap, my admin days are numbered….

    I was able to fix this situation because of this article.

    THANK YOU

  31. Loner Loner

    is there no way we can retrieve the older password in any form? Preferable through command.?

  32. Anthony Anthony

    Reading this article makes me laugh, there are so many COMPLETE MORONS here!

  33. help help

    HELP! my user name is two words (George McIntosh) and whenever I type ‘net user George McIntosh *’ I get the following error:

    The syntax of the command is:

    NET USER
    [username [password | *]] [/DOMAIN]
    username {password | *} /ADD [options] [/DOMAIN]
    username [/DELETE] [/DOMAIN]

    C:\Documents and Settings\George McIntosh>

  34. Mark Mark

    Hmmm, try your username in quote maybe. net user “George McIntosh” *

  35. kim kim

    forgot my pasword my window xp

  36. zabi zabi

    any one know about to change admin password without login in windows xp to change addmin password this is my email address Zabiullahs_f@hotmail.com

  37. zabi zabi

    plz send me about this to change the admin password without login in windows any know about it

  38. Rai Rai

    I have the serial key i want the activation code for the windows vista bussiness edition..

  39. Theodor Theodor

    I am desktop supporter at a company called consol. We have a person who loggeds on a domain witch is not ouers but also has a account on our domain our portal is connected with their ad accounts o his password expiers every 30 days but because his computer is not on our domain he is unable to renew his password do you maybe have any ideas of how he can change his password without being o the domain???Please let me know if you might have a solution on tcraggs@consol.co.za

  40. Nuno Nuno

    Hi,

    What if the username has two names seperated by a blank space?

    I have tried it like and it doenst work.

    Nuno

  41. asdf asdf

    Thanks man. This was super easy and helpful when I forgot a password.

  42. Actually I try all those sysntax in my office just to find out which one is working, but it seems none on them works. I always get the access denied and error 5, please if somebody give a solution to this, I will really appreciate it.

  43. tim tim

    If you have a two word password, maybe try using a _ for the space?

  44. Gene Gene

    I bought a laptop on flee market, was so pissed off it had an admin pass and only could use limited user.. I think i went safe mode in cmd, i think there are two cmds, one is the main main administator above your plain one when u go to cmd from computer. But hope the very main one doesnt have password, so u can change ur other regular admin pass, some reason i didnt have error 5. I try now and now i get error 5, i dont know what happened

  45. Gene Gene

    One of the first things you should do is lo into the default Administrator account and set a password. That requires booting into Safe Mode as Administrator, setting a password <<< Pay atention, maybe thats where i went, something too do with booting, change pass, sorry bad english :PP U can do it, lets hope :O

  46. Ed Ed

    Username with two words or a space – “quotation marks”
    i.e
    net user “User Name”
    net users “Dave Smith”

    “…” is tested working on – windows seven and vista.

  47. Ed Ed

    Change password with:

    net users “User Name” *

    the * is all you need.

  48. Hey guys, since it doesn’t work from guest account, enter the admin account.
    When your computer just started up ( works only for xp )
    keep pressing f8 to enter safe mode. Admin will be accessible and go to CMD from there. Then you’ll be able to change to password!
    Start up > Press f8 > Enter admin > Go CMD > CHANGE !

    *F8 must be pressed before the loading xp screen.

  49. kevin kevin

    1rd Method:
    Try following trick which is actually a loophole in Windows XP Setup and a big security hole:

    A. Boot using Windows XP Setup CD and follow the instruction like Accepting EULA, etc.

    B. When it asks to repair your existing Windows installation, accept it and press “R” to run the repair.

    C. Setup will start repairing your Windows and will start copying files, etc.

    D. After a few minutes setup will restart your system and when it restarts don’t press any key when it shows “Press any key to continue…” otherwise Setup will start from the beginning. Don’t press any key and setup will resume where it left.

    E. Now it’ll start doing other tasks and will show a small progressbar with a few details in left side.

    F. Look carefully at the details and when it shows “Installing devices”, press +F10 keys in your keyboard.

    G. It’ll open a Command Prompt window. Now type nusrmgr.cpl and press .

    H. It’ll open the same “User Accounts” window which you see in Control Panel.

    I. Now you can remove or reset any account password without any problem.

    2th Method:
    There are many 3rd party utilities which claim to reset forgotten Windows password:
    The program that I recommend is the Windows Password Key 8.0. It is a very quick and useful utility for resetting passwords. It not only supports XP, 2000, and NT, I have personally tested it with Vista Home Premium and Ultimate. It works perfectly to reset any local user account to a blank password.
    Just an easy to use bootable CD/DVD . It can also be used on a USB Flash Drive. http://sn.im/bypasswindowspassword

  50. hello dear hackers!!!!!!!!!!
    by typing commands in command prompt any body can breaik ur login password.but here is an idea that anyone can not break the password of ur login password.
    suppose………….ur account name is “aditya”
    then anybody will type./
    c:>…………/system32>net user
    he will find the all accounts on ur pc.
    after it he will type
    net user accountname *
    type a password:
    verify the psssword:
    password change successfully.

    but it is not easy to break the account with user name “aditya sharma”
    when u use a space between the user name.
    this will be when u r about 2 install win-XP then type ur computer name “””aditya(space)sharma”””
    just done it.l
    nobody can break it.

  51. girish girish

    great work, when i’m setting administrator password, then can i remove administrator password via command line or safe mode?

  52. hello man i used this technique but it only change admin password
    but i lost my adminsitrator password my computer run only in guest account so what to do i recover adminstrator password or change admin password
    please send technique for that

  53. how can i change xp passwd when administrator is locked

  54. arul arul

    i want to block all videos on the internet

  55. kertoimtvoltvtiti,./
    w]e[rrrrrr

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.