Share this article

Improve this guide

Windows Command Line Generates Random Password [Solved]

You can always reset the password

3 min. read

Updated onFebruary 5, 2024

updated onFebruary 5, 2024

Share this article

Improve this guide

Read our disclosure page to find out how can you help Windows Report sustain the editorial teamRead more

While we were configuring the built-in administrator account viaCommand Prompton 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 hitEnter, or try using the Microsoft account password if on a Microsoft account. Also,boot into Safe Modeand check whether Windows now accepts the password.

How do I sign in if the Command Prompt generates a random 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

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

Remember, you can only reset the password through theUser Accountsutility for local accounts.

4. Remove the affected user account and create a new one

Once done, you cancreate a new local accountor 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 tocreate 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 whenWindows 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.

More about the topics:Password issues,sign-in issues

Kazim Ali Alvi

Windows Hardware Expert

Kazim has always been fond of technology, be it scrolling through the settings on his iPhone, Android device, or Windows PC. He’s specialized in hardware devices, always ready to remove a screw or two to find out the real cause of a problem.

Long-time Windows user, Kazim is ready to provide a solution for your every software & hardware error on Windows 11, Windows 10 and any previous iteration. He’s also one of our experts in Networking & Security.

User forum

0 messages

Sort by:LatestOldestMost Votes

Comment*

Name*

Email*

Commenting as.Not you?

Save information for future comments

Comment

Δ

Kazim Ali Alvi

Windows Hardware Expert

Kazim is specialized in hardware devices, always ready to remove a screw or two to find out the real cause of a problem.