# Reverting 10X boot restrictions & returning to classic 10

#### Prerequisites
* A Windows 10 Setup USB of an identical or higher version than the 10X build you've used
    * For example if you're on 10X build 20279, you'll want Windows 10 Insider Preview build 20279 or newer [(download here)](https://aka.ms/wip-iso)
* An x64 EFI shell [(click here to download)](https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi?raw=true)
* gdisk64.exe (extract from ZIP) [(click here to download)](https://sourceforge.net/projects/gptfdisk/files/gptfdisk/1.0.6/gdisk-binaries/gdisk-windows-1.0.6.zip/download)

_**Before you begin, make sure Secure Boot is turned off on the machine you wish to roll back to classic 10**_

#### Tweak USB contents
* Plug in the setup USB drive
* Navigate to `efi\boot` inside your USB drive
* Rename the existing `bootx64.efi` file to `winx64.efi`
* Copy the EFI shell file you've downloaded to that directory and rename it to `bootx64.efi`
* Create a file on the root of your USB drive called `startup.nsh` and open it in Notepad
* Paste this text into Notepad and save the file:
  ```
  dmpstore -d SecureBootPlatformID -guid 77FA9ABD-0359-4D32-BD60-28F4E78F784B
  fs0:\efi\boot\winx64.efi
  fs1:\efi\boot\winx64.efi
  fs2:\efi\boot\winx64.efi
  fs3:\efi\boot\winx64.efi
  fs4:\efi\boot\winx64.efi
  fs5:\efi\boot\winx64.efi
  fs6:\efi\boot\winx64.efi
  fs7:\efi\boot\winx64.efi
  fs8:\efi\boot\winx64.efi
  fs9:\efi\boot\winx64.efi
  fsA:\efi\boot\winx64.efi
  ```
* Copy gdisk64.exe to the root of your USB drive
* The USB drive is now ready to use

#### Extra troubleshooting
Recent devices with Intel Pentium (Gold) chips that use Insyde BIOS are prone to entering a faulty Secure Boot state, resulting in the machine booting to a black screen with `Security Boot Fail` written in the middle, even though UEFI says Secure Boot is off. To fix this issue, do the following:
* Turn Secure Boot on
* Save changes and boot to UEFI settings again
* Turn Secure Boot off
* Secure Boot should now be fully disabled

#### Erasing the Windows 10X disk layout
* Boot your Windows Setup USB
* Press Shift-F10 to open the Command Prompt
    * If nothing happens, you may need to also press the Fn key if your keyboard has one
* Find the drive letter of your USB drive (for example `D:`)
    * An easy way to do this is to run Notepad and use the File>Open menu item, then go to This PC and look for it
* Navigate to it using this command (don't forget to use the appropriate letter for your own USB)
```
D:
```
* Run spaceutil to find the ID of your physical drive
```
spaceutil get-drive -poolname ospool
```
* In spaceutil's output look for the `####` column, the value can for example be `0`
* Double check that the ID is correct by running gdisk64
   * Don't forget to change `X` in the command to the ID of your drive
```
gdisk64 -l \\.\physicaldriveX
```
* Make sure that the output of gdisk64 contains **OSPool** and other partitions of Windows 10X
* Use gdisk64 to clean up the drive using the following commands
   * Don't forget to change `X` in the command to the ID of your drive
```
gdisk64 \\.\physicaldriveX
o
w
```
then press `Enter`
* Type `exit` to close the Command Prompt


_**You can now continue installing Windows 10 like you usually would**_