|
|
发表于 2021-8-30 14:53:34
|
显示全部楼层
本帖最后由 newswan 于 2021-8-30 19:54 编辑
- @echo off
- color 3F
- setlocal EnableDelayedExpansion
- bcdedit /enum {current}|find "system32\winload.exe">nul
- if %errorlevel% equ 1 (
- set bootmode=uefi
- set winload=winload.efi
- ) else (
- set bootmode=bios
- set winload=winload.exe
- )
- set vol=%SystemDrive%
- :InstPE
- ECHO 安装PE到 %vol% 盘
- if not exist %vol%\BOOT md %vol%\BOOT
- copy /y .\*.wim %vol%\BOOT\
- copy /y .\BOOT.SDI %vol%\BOOT\
- del .\*.wim
- bcdedit.exe /timeout 9
- bcdedit.exe /set {current} bootmenupolicy Legacy
- set id1={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffa}
- set id2={%time:~6,2%%time:~9,2%ffff-8d96-11de-8e71-fffffffffffb}
- bcdedit /create %id2% /d "Windows 10 PE 维护平台" /device
- bcdedit /set %id2% ramdisksdidevice partition=%vol%
- bcdedit /set %id2% ramdisksdipath \boot\boot.sdi
- bcdedit /create %id1% /d "Windows 10 PE 维护平台" /application osloader
- bcdedit /set %id1% device ramdisk=[%vol%]\boot\1064.WIM,%id2%
- bcdedit /set %id1% osdevice ramdisk=[%vol%]\boot\1064.WIM,%id2%
- bcdedit /set %id1% path \windows\system32\boot\%winload%
- bcdedit /set %id1% description "Windows 10 PE 维护平台"
- bcdedit /set %id1% locale zh-CN
- bcdedit /set %id1% inherit {bootloadersettings}
- bcdedit /set %id1% systemroot \windows
- bcdedit /set %id1% detecthal Yes
- bcdedit /set %id1% winpe Yes
- bcdedit /set %id1% ems no
- bcdedit /displayorder %id1% /addlast
- attrib +r +h +s +a %vol%\BOOT
- goto:eof
复制代码 |
评分
-
查看全部评分
|