这是我自用的,有可能适合你- @echo off
- bcdedit | findstr /i /r /c:"^description *Image For Dos 备份还原$" && (echo 引导菜单已存在&pause&exit)
-
- for /f "tokens=2delims={}" %%i in ('bcdedit /create /d "Image For Dos 备份还原" /application bootsector') do set "ID=%%i"
- bcdedit /set {%ID%} device boot
- bcdedit /set {%ID%} path \grldr.mbr
- bcdedit /displayorder {%ID%} /Addlast
-
- copy "%~dp0grldr.*" C:\
- md C:\GRUB 2>nul
- copy "%~dp0IFD.GZ" C:\GRUB\
- (
- echo find --set-root (^)/GRUB/IFD.GZ
- echo timeout 1
- echo default 0
- echo title Image For DOS
- echo map --mem (^)/GRUB/IFD.GZ (fd0^)
- echo map --hook
- echo chainloader (fd0^)+1
- echo rootnoverify (fd0^)
- )>C:\menu.lst
- attrib +R +S +H C:\grldr.*
- attrib +R +S +H C:\GRUB\*
- attrib +R +S +H C:\GRUB
- attrib +R +S +H C:\menu.lst
- pause
复制代码
|