> For the complete documentation index, see [llms.txt](https://docs.plenit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plenit.com/docs-en/support/tutorials/windows/how-to-recover-the-administrator-password.md).

# How to recover the Administrator password in Windows

Migrations

Servers

## How to recover the Administrator password in Windows

Keep reading if you want to learn **how to recover the Administrator password in Windows**, a procedure that is applicable both to recover the administrator user's password in case you don't remember it, or because the administrator is unavailable for any reason.

**NOTE:** *Plenit is not responsible for the misuse of this tutorial, since its purpose is to help administrators do their work. The purpose of this tutorial is to provide possible assistance in migration processes.*

This process must be done properly **from a physical terminal**, or **from a virtual terminal** with access to the virtual installation media, since two things are needed:

* **Access to physical or virtual power buttons** through the hypervisor.
* **Access to physical or virtual drives** to load the Windows installation CD/DVD or ISO.

It is important to say that this recovery method is valid for client and server devices. On client it works both on older ones like Windows XP and newer ones like Windows 11. The same goes on the server side; it will work with old versions and even with Windows Server 2025, which is the version on which this tutorial was made.

#### How to recover the Administrator password in Windows

#### Pre-requisites or pre-configuration

To successfully complete this tutorial and **recover the Administrator password in Windows**, you will need:

On one hand, **to be registered on the Plenit Platform** and have accessed it with your username and password through the [login](https://admin.plenit.com).

On the other hand, to have a subscription to **Servers**, an on-premises machine whose password you do not know, access to the machine's administration console, access to the installation media, either physically or virtually, to be able to load the CD/DVD or ISO of the Windows version.

#### Windows Administrator password recovery process

One must **insert the operating system image**, either in ISO format or CD/DVD format, into the drive to begin the operation.

Once inside, the machine must be booted, staying alert to **click \<ENTER> when the message of “Press any key to boot from CD or DVD…” appears**.

This will cause the boot process to be aborted and **the operating system installation process to start** .

After a brief loading process, the language selection window will appear, where you should select the language for installation, but in this case it does not matter, and it will be enough to **click “Next”**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FjV6oPcjtRt4qrKDPKYyx%2F01_Damos-siguiente-desde-la-ventana-de-idioma-de-la-instalacion-de-Windows.png?alt=media&amp;token=c8811693-cfcb-4d3f-b179-0cc62333317a" alt=""><figcaption><p>We click Next from the Windows installation language window</p></figcaption></figure>

In the next window you **must select the keyboard layout** of the installation process, although later we are asked again through a wizard, it is recommended to select it to avoid problems. After the selection, you must **click “Next”**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FegYYhKuTmk9E5Cruzucz%2F02_Seleccionamos-el-idioma-del-teclado.png?alt=media&amp;token=9f393071-23cd-4c67-9630-001bb99dae69" alt=""><figcaption><p>We select the keyboard language</p></figcaption></figure>

In the configuration options menu, you must **select “Repair my PC”** and **click “Next”**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FoXfqSGggw5nkRs8i8Qyv%2F03_Seleccionamos-reparar-el-sistema.png?alt=media&amp;token=1b5e444a-23b3-427f-a67d-77a75240a8fd" alt=""><figcaption><p>We select the option to repair the system</p></figcaption></figure>

In this small wizard, the keyboard layout is selected **again**, as can be seen, **not all keyboard layouts fit** so more must be shown **by clicking “See more keyboard layouts”**. When the one you want is found, you must **select it to continue**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FQphwbYnr1P5iH9ow9bEH%2F04_Seleccionamos-la-distribucion-del-teclado-en-el-Wizard.png?alt=media&amp;token=6243883a-cabc-4727-b86a-6c46b1eace09" alt=""><figcaption><p>We select the keyboard layout in the wizard</p></figcaption></figure>

In the next menu you must **click “Troubleshoot”** to display the recovery options.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FHlQBupPfk5KwmLaG6CoM%2F05_Seleccionamos-la-opcion-de-Troubleshooting.png?alt=media&amp;token=6fc23e38-f1c4-4d32-b24d-f3e3c8459f0e" alt=""><figcaption><p>We select the Troubleshooting option</p></figcaption></figure>

Among the available options you must **click “Command Prompt”** to launch the CMD console.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FeW7FgGSfhGMbiFUBHxfR%2F06_Seleccionamos-la-opcion-de-Command-Prompt.png?alt=media&amp;token=7fcc42b3-bc59-400d-83ad-5102d57b6fdc" alt=""><figcaption><p>We select the Command Prompt option</p></figcaption></figure>

Once we have the CMD window, we will see that **we are on drive “X:”** which is a virtual drive. At this point **we must access the hard drive where the Windows operating system is installed**, that is “c:”. The problem is that at this moment we are operating on a virtual operating system so to access the root of the installed system we must look for the corresponding drive letter; **It is most likely “D:”**.

To access it, do the following:

```
<p># d:<br /> # cd Windows\system32</p>
```

Next, **the file “sethc.exe” must be copied to another location** to have a **backup copy**, for this we will do: (pay attention to the two dots “..”)

```
<p># copy sethc.exe ..</p>
```

This **copies the file to the lower folder, preventing us from deleting it** since we will have to recover it when the operation is finished.

The next step is **to copy “cmd.exe” and overwrite “sethc.exe”** so that later, when we load this program, instead of accessing Sticky Keys, the command line loads and we can make changes in the system.

```
<p># copy cmd.exe sethc.exe </p>
```

When making the copy, since we are overwriting a file, **it asks us about the operation** and we must **answer affirmatively with a “yes”**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FSity5jBFamP1Z2o4ufVZ%2F07_Copiamos-command-para-sustituir-al-sethc.png?alt=media&amp;token=dce2814c-4eaa-4e82-afd2-9d36572b9663" alt=""><figcaption><p>We copy command to replace sethc</p></figcaption></figure>

After these changes, we must **restart the machine**, in any way desired, either with a reboot command, by pressing the power button, etc.

**After the restart,** **on the login screen** we must **press the Shift key 5 times** which will cause a call to “sethc.exe”, but in this case it has been replaced by “cmd.exe”, so CMD will be loaded.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2F8yISLeb4cvRbB7bKLV5q%2F08_Pulsamos-5-veces-la-tecla-shift.png?alt=media&amp;token=872fb9d1-35b7-4b28-8d29-be6e4ab337a0" alt=""><figcaption><p>We press the Shift key 5 times</p></figcaption></figure>

When Windows command (CMD) or command line starts, we **can query the user with which it was started** by running the command:

```
<p># whoami</p>
```

And the system **will return the message “nt authority\system”** that is, a user with **the ability to change passwords or create new users**, which is basically what we want.

To recover the password, since **the previous one cannot be seen** (for security reasons, as is logical), **we will use a command that allows passwords to be reassigned** to existing users or define new users.

```
<p># NET USER <Usuario> <NuevaContraseña></p>
```

Where:

* **\<User>** : should be **“Administrator” for Spanish systems** or **“Administrator” for English systems**.
* **\<NewPassword>** : The **new password** that we want to set for this password recovery.

In the case of the example, as can be seen, the command is:

```
<p># NET USER Administrator MiContraseña01</p>
```

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2Fyo5259Zf4Hv16zEc9WOM%2F09_Cambiamos-la-contrasena-del-administrador.png?alt=media&amp;token=04d1df7d-f5aa-4b2d-bfa9-7f227c5dace1" alt=""><figcaption><p>We change the administrator password</p></figcaption></figure>

Once this is done, you can **close or minimize the CMD window** to **enter the password** that we have just assigned.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FpQmjjxmh1FUMsbz438BX%2F10_Introducimos-la-contrasena-que-hemos-asignado.png?alt=media&amp;token=8a9f8e78-4958-4c59-ab56-9267b17b9f60" alt=""><figcaption><p>We enter the password we have assigned</p></figcaption></figure>

At this point **the session will load** without problems and you can work normally.

**NOTE:** *As we can see in the image below, the version on which the procedure was done is Windows Server 2025.*

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FWVCk0WyZjes5fEUYeKaN%2F11_En-este-momento-se-entrara-en-la-sesion-y-podremos-ver-que-operamos-normalmente.png?alt=media&amp;token=690c99c5-5d8d-46b9-acdf-b228c37f982a" alt=""><figcaption><p>At this point you will enter the session and we can see that we are operating normally</p></figcaption></figure>

For the system to be properly configured **the file “sethc.exe” must be put back in place**, deleting the “cmd.exe” that we had put in its place to perform this password recovery process.

To make the copy **you must use the command “robocopy”** from which you can learn more by reading the article we dedicated to it [How Windows behaves with File Storage](https://jotelulu.com/blog/windows-copiar-mover-datos-almacenamiento-de-archivos-en-la-nube/). If we try to do a normal Windows “copy” it will not allow us to copy it due to user privileges.

To make the copy you must **type the command** as follows:

```
<p># Robocopy C:\Windows C:\Windows\System32 sethc.exe /B</p>
```

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FfaGx6OWw5vHVqXz2Ecpp%2F12_Recuperamos-la-configuracion-de-ficheros-original.png?alt=media&amp;token=125240b0-d566-4ada-9491-fc0a9fab60e1" alt=""><figcaption><p>We restore the original file configuration</p></figcaption></figure>

A good practice is that **after the change, try pressing Shift 5 times to see if it has returned to normal**.

<figure><img src="https://3894148717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxksPMyYRDCe4qKkhbpcY%2Fuploads%2FjGaTwxGpBGscLdwa0V5N%2F13_Comprobamos-que-el-proceso-de-5-veces-Shift-ha-vuelto-a-la-normalidad.png?alt=media&amp;token=91afa1ec-a8a1-47c0-b822-f3794aa0f3ab" alt=""><figcaption><p>We check that the 5-times Shift process has returned to normal</p></figcaption></figure>

And with this **we will have the machine operational** again.

#### Conclusions and next steps:

The process described in this tutorial allows **recover the Administrator password in Windows** in a simple way. This process is carried out in very few steps, as we have seen in this tutorial.

If you want **to see how to do it in GNU/Linux** visit this other tutorial:

* [How to recover the root password in GNU/Linux](https://jotelulu.com/soporte/tutoriales/como-recuperar-la-contrasena-de-root-en-gnu-linux/)

We hope that with this small guide you won't have problems, but if you do, don't hesitate to contact us so we can give you a hand.

Thank you for your trust!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.plenit.com/docs-en/support/tutorials/windows/how-to-recover-the-administrator-password.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
