Monday, February 19, 2024

Forgot Windows password?

 Surely there have been situations where someone has forgotten their Windows password and can no longer access the computer?

The same thing has happened to me several times and I usually change the password manually, which is a bit troublesome, but the day before yesterday, when a friend had forgotten the password on his old computer, I decided to write down these commands and make two simple scripts.

1. First of all, you need a Windows USB stick, take an empty 8Gb memory stick and download Windows media tool for free from the official MS page.

https://www.microsoft.com/en-us/software-download/windows10

I named this project RenU (Rename Utilman) because in the process we need to replace Utilman with CMD.

2. Unpack and copy the two BAT files Newpass.bat and RenU.bat to the root directory of the Windows USB stick. Open Newpass.bat with Notepad or any editor and change the first line "net user Lockeduser newpassword"

3. Start the computer where you don't know the password from the USB stick, depending on the model of the computer you have to press F11, F12 or ESC before starting Windows to open boot menu where you can choose to start from USB.

4. When Windows setup has started, a blue screen will appear where you can choose the language that suits you and press next, if you do not want to install a new clean Windows (you will lose all your files and data), then do not press next anymore, but select repair from the bottom left corner.

A new light blue window will open with Advanced and Command Prompt below.

5. Now a big black window "Command Prompt" opened, where in the bottom left corner you can see that you are on virtual disk X: now you have to find out what is the name of your USB disk, if you have only one disk on your computer C:, then probably your USB disk is D:, but if you have more disks, try writing E: F:, etc.

If you want to check whether you typed the correct disk name, type "DIR" to see the contents of the disk.

6. If you see your previously copied files Newpass.bat and RenU.bat there, just type renu and press enter it will move Utilman.exe from the Windows directory to C: in case you ever need it and replace it with Cmd.exe with a file called "Command Prompt".

And copies Newpass.bat to the C: drive, where you will need it after the restart. Now remove the USB stick and restart the computer.

7: When Windows has restarted, you still see the locked user, but next to the "Power" icon in the bottom right corner, there is another strange icon (Utilman) which we replaced with cmd.exe.

Now click it until the old familiar "Command Prompt" opens and type "newpass" there, which overwrites the user's old password.

If everything went well and there was no error message, you can log in with a new code after restart, but if there was an error message or something went wrong, you can write "net user Lockeduser newpassword".

Download RenU