---
title: "Edit the OS registry in WinPE"
sidebar_label: "Edit the OS registry in WinPE"
sidebar_position: 4
description: "How to edit the OS registry in WinPE recovery and diagnostic mode"
---

import Formbricks from '@theme/MDXComponents/Formbricks'

# Edit the OS registry in WinPE

If the operating system does not boot due to registry errors, you need to access the registry and fix the error.

1. [Boot the server in WinPE recovery and diagnostic mode](/dedicated/troubleshooting/boot-to-recovery.mdx).

2. Open `cmd`.

3. Open **Registry Editor**. It displays the state of the WinPE boot environment registry:

   ```bash
   regedit
   ```

4. In the list on the left, select `HKEY\_LOCAL\_MACHINE`.

5. In the **File** menu, select **Load hive**.

6. In the dialog box, navigate to the directory where the system and registry files are located; this is usually `C:\Windows\System32\config`.

7. Select a file named **system** or **software**.

8. Enter the branch name to be used for mounting to the `HKEY\_LOCAL\_MACHINE` hive, for example `MountedSYSTEM`. The branch name must not match any existing branches in `HKEY_LOCAL_MACHINE`.

9. Click **Open**. The registry hive will appear in the section.

10. Find and edit the required parameter.

11. Click **File** and select **Unload hive**. The changes will be saved to the registry.

12. [Restore the previous server boot template](/dedicated/troubleshooting/boot-to-recovery.mdx#restore-server-boot-template) or reboot the server from the OS. When rebooting the server from the OS, the boot template will automatically change to the one that was set before [changing the server boot template](/dedicated/troubleshooting/boot-to-recovery.mdx#change-server-boot-template).

<Formbricks />
