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>


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

net user <username> *


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


  1. Roman Roman

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

  2. Mark Mark

    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


    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..


  15. mehmet mehmet


    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. pramod pramod

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

  23. vignesh vignesh

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


    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!

  25. mohit mohit

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


  26. 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

  27. 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?

  28. 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.


  29. Loner Loner

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

  30. Anthony Anthony

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

  31. 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:

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

    C:\Documents and Settings\George McIntosh>

  32. Mark Mark

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

  33. zabi zabi

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

  34. Rai Rai

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

  35. Nuno Nuno


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

    I have tried it like and it doenst work.


  36. asdf asdf

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

  37. 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.

  38. tim tim

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

  39. 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

  40. 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

  41. Ed Ed

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

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

  42. Ed Ed

    Change password with:

    net users “User Name” *

    the * is all you need.

  43. 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.

  44. 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.

  45. 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.

  46. girish girish

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

  47. 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

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

  49. arul arul

    i want to block all videos on the internet

Comments are closed.