9

Is it possible to remove a user's password using the net command?

I tried "net user <name> *" and just hitting return twice, but this does not work as expected. Is there any other way to do this? (I'd gladly take non-net commands, as long as they are built-in in XP SP3).

Edit: Seems, I did not make my intention clear. I don't just want to change the password, but remove it completely (so that the user may log in without having to supply a password).

I'm familiar with the "net"-reference and have searched online for several hours, but could not find a hint on how to do this.

3
  • Is this for local accounts or for domain accounts?
    – MDMarra
    Mar 22, 2010 at 21:12
  • local accounts (btw.: my statement was correct in the beginning, but <name> was swallowed because I used angle brackets instead of &lg and &gt)
    – Markus Bruckner
    Mar 22, 2010 at 21:21
  • net user <name> * --> <Enter> --> <Enter>
    – kev
    Sep 4, 2011 at 5:52

4 Answers 4

16

The command to set a password to blank is simply this:

net user username ""

Execute it in a Command Prompt (cmd) that is Run as Administrator.

Note: There's a nice vbs script that tests which account has a blank password here.

6
  • 1
    Sorry, but this doesn't work neither (tried it before I posted the question and again just now in case I had had a typo before)
    – Markus Bruckner
    Mar 29, 2010 at 10:36
  • 1
    @markus.bruckner: Well, I tried it before I posted, and it did work for me. Are you sure that system policies allow blank passwords?
    – harrymc
    Mar 29, 2010 at 11:06
  • @harrymc: There is no such system policy. I will look into it again.
    – Markus Bruckner
    Apr 9, 2010 at 11:03
  • I can confirm this does work, it removes the password rather than changing it.
    – Zombo
    Jun 20, 2014 at 6:41
  • 1
    For me this doesn't do anything if executed in a PowerShell window but works when running in cmd.exe Jul 4, 2016 at 13:30
5

Run net user <username> /passwordreq:no in an command prompt opened under the Administrator account's context (In Win XP hold down shift and right click on cmd.exe to Open as another user, then enter in the "Administrator" account's password; Win Vista+ just right click and select Run as Administrator). Then run net user <username> <password>

This has the advantage over net user <username> "" that it allows one to change the user in question's password from something to nothing, in lusrmgr.msc and other GUI user management tools, as well as using the net user command in future.

More info: https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_user.mspx+&cd=1&hl=en&ct=clnk&gl=us

NOTE: Yes, this is very similar to jordyonrust's answer as I haven't had much success with editing other's answers to correct minor mistakes/omissions (the latter more often when I need to make more than a couple of character changes to correct a mistake and the additional information "changes the intent of the answer too much").

-1
net user <username> passwordreq:[yes or no] 

Used to determine if the account needs a password. Not sure it works. Maybe this will do?

You also might find this interesting: Net.exe reference

1
  • 1
    Sadly, this doesn't work neither. This option just states that the user doesn't have to have a password. Btw.: The link you provided seems to target a server os, and not Windows XP.
    – Markus Bruckner
    Mar 22, 2010 at 21:17
-2

the command is

net user USERNAME PASSWORD

if you leave the password blank it may remove the password, however I have a minimum password policy on this machine and I cant set a password with 0 characters

1
  • 1
    Tried this already. Since the password is optional, the processor cannot know if one supplies no or an empty password.
    – Markus Bruckner
    Mar 22, 2010 at 21:12

You must log in to answer this question.