Windows Command Line Generates Random Password [Solved]
You can always reset the password
3 min. read
Updated on
Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more
While we were configuring the built-in administrator account via Command Prompt on one of the workstations, it seemed like the Windows command line automatically generated a random password. As a result, we couldn’t sign in.
When we looked it up, the problem was quite common. While trying to activate the administrator account, users often end up reconfiguring the password for another one.
So, if you are having trouble signing in, leave the password field blank and hit Enter, or try using the Microsoft account password if on a Microsoft account. Also, boot into Safe Mode and check whether Windows now accepts the password.
How do I sign in if the Command Prompt generates a random password?
1. Check the user account
Your primary approach should be to verify the current user account. After activating the built-in administrator account, it might be selected by default on the Windows login screen, and you could enter the password instead of your other account.
So, select the correct account from the left (all accounts are listed here), and you should be able to sign using the previously set password.
2. Disable the built-in administrator account
- On the Windows login screen, click the Power button, then hold the Shift key, and select Restart.
- Once the PC enters the Windows RE (Recovery Environment), click on Troubleshoot.
- Select Advanced options.
- Choose Command Prompt.
- Choose an account for which you know the password, enter it in the text field, and click Continue.
- Type the following command and hit Enter:
net user administrator /active:no
- Once done, restart the computer and check whether you can now sign in.
If the Windows command line generates a random password while enabling the administrative user account, you can always disable it and check whether that reverts the changes.
3. Sign in with another account and reset the password
- Sign in with the administrator account, the one used to create the affected user profile.
- Press Windows + R to open Run, type netplwiz in the text field, and hit Enter.
- Select the affected account from the list, and click the Reset Password button.
- Enter the new password in both fields, and click OK to confirm.
- Finally, you should be able to sign in to the affected profile using the new password.
Remember, you can only reset the password through the User Accounts utility for local accounts.
4. Remove the affected user account and create a new one
- Sign in with another administrator account, press Windows + R, type netplwiz, and click OK.
- Select the affected user account, and click Remove.
- Click Yes in the confirmation prompt.
Once done, you can create a new local account or sign in with a Microsoft account. We would recommend using the latter because you get far more recovery options, which would come in handy in situations like this.
5. Reinstall Windows
If nothing else works after the command line generates a random password, the only option left is to reinstall Windows. You will first need to create a bootable USB, then change the boot border, and finally, use the USB to install Windows.
This will most likely result in data loss. Still, at this point, it’s the most viable solution to regain access because for the built-in recovery options to work, you need the password for at least one administrator account on the PC, which you most likely don’t have.
Also, find out what to do when Windows is not accepting the password, as some of these may help in this case!
For any queries or to share what worked for you, drop a comment below.
User forum
0 messages