|
本帖最后由 quimeng 于 2017-10-10 14:30 编辑
如题,批处理修改最好,谢谢
@echo off
for /f "tokens=1,2,* delims= " %%a in ('echo list disk^|diskpart^|find /i "B"') do (
(echo,%%c|find /i "*" >nul 2>nul) && (
goto gpt
) || (
goto mbr
)
)
goto end
:mbr
bcdedit /create {ffffffff-8d96-11de-8e71-ffffffffffff} /d "一键还原工具箱" /device
bcdedit /create {ffffffff-8d96-11de-8e71-fffffffffffe} /d "一键还原工具箱" /application osloader
bcdedit /set {ffffffff-8d96-11de-8e71-ffffffffffff} ramdisksdidevice partition=C:
bcdedit /set {ffffffff-8d96-11de-8e71-ffffffffffff} ramdisksdipath \MYDOS\boot.sdi
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} device ramdisk=[C:]\MYDOS\PE.wim,{ffffffff-8d96-11de-8e71-ffffffffffff}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} path \windows\system32\boot\winload.exe
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} description 一键还原工具箱
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} locale zh-cn
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} inherit {bootloadersettings}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} osdevice ramdisk=[C:]\MYDOS\PE.wim,{ffffffff-8d96-11de-8e71-ffffffffffff}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} systemroot \windows
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} detecthal Yes
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} winpe Yes
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} ems no
bcdedit /displayorder {ffffffff-8d96-11de-8e71-fffffffffffe} /addlast
bcdedit /timeout 5
goto end
:gpt
bcdedit /create {ffffffff-8d96-11de-8e71-ffffffffffff} /d "一键还原工具箱" /device
bcdedit /create {ffffffff-8d96-11de-8e71-fffffffffffe} /d "一键还原工具箱" /application osloader
bcdedit /set {ffffffff-8d96-11de-8e71-ffffffffffff} ramdisksdidevice partition=C:
bcdedit /set {ffffffff-8d96-11de-8e71-ffffffffffff} ramdisksdipath \MYDOS\boot.sdi
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} device ramdisk=[C:]\MYDOS\PE.wim,{ffffffff-8d96-11de-8e71-ffffffffffff}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} path \windows\system32\boot\winload.efi
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} description 一键还原工具箱
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} locale zh-cn
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} inherit {bootloadersettings}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} osdevice ramdisk=[C:]\MYDOS\PE.wim,{ffffffff-8d96-11de-8e71-ffffffffffff}
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} systemroot \windows
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} detecthal Yes
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} winpe Yes
bcdedit /set {ffffffff-8d96-11de-8e71-fffffffffffe} ems no
bcdedit /displayorder {ffffffff-8d96-11de-8e71-fffffffffffe} /addlast
bcdedit /timeout 5
:end
|
|