Skip to content

Instantly share code, notes, and snippets.

@iamacarpet
Last active January 25, 2024 09:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamacarpet/da212b5706cadfc731fb84500285cd10 to your computer and use it in GitHub Desktop.
Save iamacarpet/da212b5706cadfc731fb84500285cd10 to your computer and use it in GitHub Desktop.
Glazier WinPE boot from existing Windows install
cd C:\Windows\Temp
& curl.exe --output glazier.iso https://storage.googleapis.com/example-glazier-files/OSDCloud-WinPE-Glazier.iso
Mount-DiskImage C:\Windows\Temp\glazier.iso -PassThru
$driveLetter = ($mountResult | Get-Volume).DriveLetter
Copy-Item -Path $( -join($driveLetter, ":\sources\") ) -Destination C:\sources -Recurse
mkdir C:\boot
Copy-Item -Path $( -join($driveLetter, ":\boot\boot.sdi" ) ) -Destination C:\boot\boot.sdi
Dismount-DiskImage C:\Windows\Temp\glazier.iso
& C:\Windows\System32\bcdedit.exe /create "{ec9c9d32-6ee9-41c9-8c45-be125520c228}" /device
& C:\Windows\System32\bcdedit.exe /set "{ec9c9d32-6ee9-41c9-8c45-be125520c228}" ramdisksdidevice partition=C:
& C:\Windows\System32\bcdedit.exe /set "{ec9c9d32-6ee9-41c9-8c45-be125520c228}" ramdisksdipath \boot\boot.sdi
& C:\Windows\System32\bcdedit.exe /create "{f5f36258-5e9b-4b2c-b171-62337323ea87}" /d "Windows PE" /application osloader
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" device ramdisk=[C:]\sources\boot.wim,{ec9c9d32-6ee9-41c9-8c45-be125520c228}
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" path \windows\system32\winload.efi
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" osdevice ramdisk=[C:]\sources\boot.wim,{ec9c9d32-6ee9-41c9-8c45-be125520c228}
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" systemroot \windows
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" winpe yes
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" nx optin
& C:\Windows\System32\bcdedit.exe /set "{f5f36258-5e9b-4b2c-b171-62337323ea87}" detecthal yes
& C:\Windows\System32\bcdedit.exe /bootsequence "{f5f36258-5e9b-4b2c-b171-62337323ea87}"
& C:\Windows\System32\shutdown.exe /f /r /t 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment