|
本帖最后由 2013kyj 于 2021-3-1 11:00 编辑
使用下面的批处理代码,可以添加如图1所示的PE引导项, 但是还不能直接用,需要更改图2的两项才可以, 更改后,就可以把PE的BOOT.wim和BOOT.sdi文件拷到C盘根目录下,进行引导了!
求精通PE引导的高手,更改一下批处理, 使得无须进行图2的两项设置,直接就可以生效,非常感谢!
百度和论坛搜索了一些类似的, 但都是关于MBR类型的PE引导的内容!
注意,下面的代码,只适合GPT类型的分区,UEFI引导的Windows系统
- mountvol z: /s
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /delete {490b08e5-3a90-4d03-bee5-9d9673121391}
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {ramdiskoptions} ramdisksdidevice boot
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {ramdiskoptions} ramdisksdipath \BOOT.sdi
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /create {490b08e5-3a90-4d03-bee5-9d9673121391} /d "Win PE" /application osloader
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} device boot
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} device ramdisk="[boot]\BOOT.wim,{ramdiskoptions}"
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} osdevice ramdisk="[boot]\BOOT.wim,{ramdiskoptions}"
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} path \Windows\system32\boot\winload.efi
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} locale zh-CN
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} inherit {bootloadersettings}
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} systemroot \windows
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} BootMenuPolicy Legacy
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} detecthal yes
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /set {490b08e5-3a90-4d03-bee5-9d9673121391} winpe yes
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /displayorder {490b08e5-3a90-4d03-bee5-9d9673121391} -addlast
- bcdedit /store Z:\EFI\Microsoft\Boot\BCD /timeout 6
- pause
复制代码
|
|