|
本帖最后由 mr8246 于 2024-9-15 23:39 编辑
新建一个WIM启动项
@echo off
bcdedit /timeout 10
for /f "delims={,} tokens=2" %%a in ('bcdedit /create /d "PE" -application osloader') do set Guid={%%a}
bcdedit /set %Guid% device ramdisk="[d:]\boot\boot.wim,{ramdiskoptions}"
bcdedit /set %Guid% osdevice ramdisk="[d:]\boot\boot.wim,{ramdiskoptions}"
bcdedit /set %Guid% path \Windows\system32\boot\winload.exe
bcdedit /set %Guid% locale zh-CN
bcdedit /set %Guid% systemroot \windows
bcdedit /set %Guid% BootMenuPolicy legacy
bcdedit /set %Guid% DetectHal Yes
bcdedit /set %Guid% WinPE Yes
bcdedit /displayorder %Guid% -addlast
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=D:
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
根据大侠的脚本,及参考bootice添加项,改了一下,添加
bcdedit /set %Guid% BootMenuPolicy legacy
bcdedit /set %Guid% DetectHal Yes
bcdedit /set %Guid% WinPE Yes
bcdedit /create {ramdiskoptions}
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=D:
bcdedit /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi
但是这个for循环是输出Guid字符串的,没看懂怎么输出的,试了一下把语句for /f "delims={,} tokens=2"里面的逗号去掉也可以
|
|