For Windows home users, having a login password is not absolutely necessary if the physical access to the device is restricted. Also, anyone running automated tests with login, you may want to enable login automatically without being prompted for a password. Learn how to remove user password for a local user from windows command prompt.
Net user does not support much password related operations. So we use WMIC command for this purpose.
wmic useraccount where name='loginId' set PasswordRequired=false
Example:
Before removing password
c:\>net user test1 | findstr "Password" Password last set 5/8/2019 8:02:07 PM Password expires 8/6/2019 8:02:07 PM Password changeable 5/8/2019 8:02:07 PM Password required Yes
Now run the command to remove password
c:\>wmic useraccount where name='test1' set PasswordRequired=false
Now check using ‘net user’ again
c:\>net user test1 | findstr "Password" Password last set 5/8/2019 8:04:12 PM Password expires 8/6/2019 8:04:12 PM Password changeable 5/8/2019 8:04:12 PM Password required No
Note that the WMIC command to remove password should be run run from elevated administrator command prompt. From a normal command prompt, it throws the below error.
C:\>wmic useraccount where name='test1' set PasswordRequired=false Updating property(s) of '\\MYPC\ROOT\CIMV2:Win32_UserAccount.Domain="MYPC",Name="test1"' ERROR: Description = Generic failure
This can be done with a slight change to the command shown previously. Just remove the ‘where’ clause and it should update it for all users on the computer.
wmic useraccount set PasswordRequired=false
wmic useraccount where name='test1' set PasswordRequired=true
Adding users from command line is much easier than going through the UI. It saves…
Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…
We can kill a process from GUI using Task manager. If you want to do…
Chrome is definitely the stable browser compared to other ones and it has been my…
Windows has multiple command line utilities that can help find the version of the Windows…
There are multiple ways to check whether a Windows computer is running 32-bit OS or…
View Comments
Hello, Thank you for sharing this. helps a lot!
Hi,
Any help to undo this command line? Somebody used it to lock me out of my comp. Or something like it, not really sure. When I try to reboot, the command prompt shows a "no optin" code.
Please help a harassed user to get to my work!
Need to delete forgotten admin password. Command prompt not accessible without admin password.