|
本帖最后由 chanel 于 2013-4-11 20:15 编辑
有一个批处理模块AutoMENU,代码如下。如果用G4D命令command /BOOT/GRUB/Automenu引导,在GFX模式下会出现乱码,在VBE模式下则没有乱码。怎样实现在GFX模式显示正常?还有,显示的菜单位置有些偏,此批处理调整菜单位置的命令是哪些?
!BAT
debug off
checkrange 20110918:-1 read 0x8278 || echo Please use grub4dos-0.4.5b-2011-09-18 or above! && exit 1
if NOT "%automok%"=="YES" && call :begin
configfile (md)0x23000+0x10
:begin
set spacing=8
echo -e debug off \n#terminal --font-spacing= \ndefault 3\ntimeout 60\ntitle\nclear\ntitle\nclear\ntitle\nclear > (md)0x23000+0x10
find --set-root --ignore-cd --ignore-floppies /ISOS/setup.bat && ls /ISOS/ | call :automenu ! set /a spacing=%spacing%+2
call :defaultmenu
write --offset=0 (md)0x23000+0x10 terminal --font-spacing=0:%spacing%
set automok=YES
exit
:automenu
if "%1"=="" exit
if not "%1"=="" call :makemenu %1
shift
goto :automenu
exit
:makemenu
if /i "%~x1"==".iso" && call :iso %1
exit
:iso
ls (0xfa)/ && map --unmap=0xfa && map --rehook
map ()/ISOS/%1 (0xfa) || echo 文件不连续!无法用该1%安装Windows。 && pause --wait=6 && exit
map --rehook
if exist (0xfa)/WIN51 && if exist %ufd%srs/siso && call :winnt5x %1 ! call :WINNT6x %1
exit
:winnt5x
echo -e title \xE5\x90\xAF\xE5\x8A\xA8\x20\x20%~n1 >> (md)0x23000+0x10
echo -e command %ufd%vbe/NT5XSETUP %1 >> (md)0x23000+0x10
exit
:WINNT6x
echo -e title \xE5\x90\xAF\xE5\x8A\xA8\x20\x20%~n1 (Shift+F10) >> (md)0x23000+0x10
echo find --set-root --ignore-cd --ignore-floppies /ISOS/%1 >> (md)0x23000+0x10
echo -e write --offset=14 ()/ISOS/Setup.bat S ; >> (md)0x23000+0x10
echo -e write --offset=14 ()/ISOS/Setup.bat start template.bat %1 >> (md)0x23000+0x10
echo -e if exist (0xfa)/ && map --unmap=0xfa && map --rehook >> (md)0x23000+0x10
echo -e map ()/ISOS/%1 (0xfa)\nmap --rehook\nchainloader (0xfa) >> (md)0x23000+0x10
exit
:defaultmenu
find --devices=h /ntldr && call :bntldr ! set /a spacing=%spacing%+1
find --devices=h /bootmgr && call :bbootmgr ! set /a spacing=%spacing%+1
set i=1
cdrom --init && map --rehook && call :cda %i% ! set /a spacing=%spacing%+1
echo title 资源管理器 >> (md)0x23000+0x10
echo -e command %ufd%VBE/filelist >> (md)0x23000+0x10
echo title GRUB命令行 >> (md)0x23000+0x10
echo -e commandline >> (md)0x23000+0x10
echo title 磁盘 映射 >> (md)0x23000+0x10
echo -e command %ufd%VBE/devmap \x7C\x7C configfile (md)0x23000+0x10 >> (md)0x23000+0x10
echo title 重 启 >> (md)0x23000+0x10
echo -e reboot >> (md)0x23000+0x10
echo title 关 机 >> (md)0x23000+0x10
echo -e halt >> (md)0x23000+0x10
echo title 返回主菜单 >> (md)0x23000+0x10
echo -e configfile %ufd%VBE/menu.lst >> (md)0x23000+0x10
exit
:cda
ls (cd%i%)/ && call :cdb %i% && exit
set /a i=%i%+1
if %i%>=4 && exit
goto :cda
exit
:cdb
echo title 从光驱启动 >> (md)0x23000+0x10
echo -e chainloader (cd%1) \x7C\x7C configfile (md)0x23000+0x10 >> (md)0x23000+0x10
exit
:bntldr
echo title 启动Windows 2K/2K3/XP >> (md)0x23000+0x10
echo -e command %ufd%VBE/findboot ntldr \x7C\x7C configfile (md)0x23000+0x10 >> (md)0x23000+0x10
exit
:bbootmgr
echo title 启动Windows Vista/7/8 >> (md)0x23000+0x10
echo -e command %ufd%VBE/findboot bootmgr \x7C\x7C configfile (md)0x23000+0x10 >> (md)0x23000+0x10
exit |
|