|
还是按照我的方式改得面目全非了.大家可以试试看有没有什么问题.
需要最新版本的GRUB4DOS(今天的版本)
- !BAT
- ::GRUB4DOS 批处理脚本 run
- ::使用方法:
- ::RUN /path/filename.bin
- ::RUN FIRADISK /path/filename.iso
- ::RUN /path/filename.img
- ::RUN /path/fileldr
- ::来源无忧启动论坛:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=182793&extra=page%3D1
- ::原版作者:sratlf ,修改:chenall
- ::需要的外部命令WENV下载:
- ::http://bbs.wuyou.net/forum.php?mod=viewthread&tid=182254&page=102#pid2110281
- debug off
- checkrange 20101213:-1 read 0x8278 || echo Err: Version too old! && exit 1
- delmod -l wenv || insmod WENV
- WENV check "%~1"=="" && goto input
- :start
- WENV check "firadisk"=="%~1" && goto firaiso
- WENV check "%~1"=="" && goto help
- echo -e \nNow loading %1...\n
- find --set-root %1
- WENV check ""=="%~x1" && goto chain
- WENV check ".bin"=="%~x1" && goto binfile
- WENV check ".iso"=="%~x1" && goto isofile
- goto imgfile
- :imgfile
- map --mem %1 (fd0)
- map --hook
- WENV check "%~2"<>"" && write --offset=317 (fd0)/autoexec.bat %2 end
- rootnoverify (fd0)
- chainloader +1
- goto :eof
- :binfile
- map --mem %1 (rd)
- map --in-place ()+1 (hd0)
- map --hook
- root (hd0,0)
- chainloader (rd)+1
- goto :eof
- :isofile
- map %1 (0xff) || map --mem %1 (0xff)
- map --hook
- chainloader (0xff)
- goto :eof
- :chain
- chainloader --force %1
- goto :eof
- :input
- clear && echo -e \nPlease input the ISO/IMG PATH or press Enter to use /WIN$.ISO as default.\n
- WENV set path=$U,$input,Input PATH here, begin with "/" :
- WENV get path || clear && echo -e \nNow use /WIN$.ISO as default. && WENV set path=/WIN$.ISO
- ::这里因为wenv的问题目前暂时这样处理,否则可以直接
- ::WENV call call start %1 ${path}
- WENV echo -n ${path} | call start %1
- goto :eof
- :firaiso
- WENV check "%~2"=="" goto input
- WENV echo -e \nNow loading firadisk\n
- find --set-root /BOOT/IMGS/FIRADISK.IMG
- map --mem /BOOT/IMGS/FIRADISK.IMG (fd1)
- map --mem (md)+2880 (fd0)
- map --hook
- dd if=(fd1) of=(fd0) count=1
- echo Now loading %2
- call :isofile %2
- echo -e \nPress "I" to boot from iso and any other key to continue System Installation(boot from harddisk).
- ::pause命令经过增强,会返回按键的ASCII值.0x69,0x49分别是i的大小写ASCII码.
- checkrange 0x69,0x49 pause --wait=5 && goto :eof
- find --set-root --devices=h /WIN_NT$.~BT/SETUPLDR.BIN && chainloader ()/WIN_NT$.~BT/SETUPLDR.BIN && exit
- find --set-root --devices=h /NTLDR cat --length=0 /NTDETECT.COM
- chainloader /NTLDR
- goto :eof
- :help
- echo Usage: RUN [FIRADISK] file/binfile
复制代码 |
-
-
RUN.rar
1.26 KB, 下载次数: 139, 下载积分: 无忧币 -2
|