用下面的比较灵活,不用去数位置,寻找特征字符替换就行了。 注意autoexec.bat中,set sys=后面要有足够的空格。 ====NTBOOT============ !BAT debug off checkrange 20111212:-1 read 0x8278 || call :error Not supported grub4dos version! set NTBOOT=%~f0 setlocal :recovery map --mem %NTBOOT%.BMP/W7REVHD.IMG (fd0) map --hook ::查找VHD镜像所在分区,获取分区号 find --set-root --ignore-floppies --ignore-cd /vhdos/win7/win7_child.vhd (fd0)/diskid cat --skip=0x4ff00 (md)+0x300 | set vhdp= ::准备 omnfis 标准盘符 echo %vhdp% > (md)0x200+1 cat --locate=\: --replace=\. (md)0x200+1 cat (md)0x200+1 | set vhdp= :: 盘符写入指定位置 write --offset=52 (fd0)/autoexec.bat %vhdp%\r\n cat --locatei="set sys=" --replace="set sys=WIN7" --number=1 (fd0)/autoexec.bat chainloader (fd0)/io.sys boot exit =====autoexec.bat============================== @echo off cls tway /np >nul :sys_set set v_part=:::::::::: set sys= cls echo. wbat text 3,6 (+green on black)"正删除%SYS%_child.vhd并从%SYS%_bak.vhd恢复,稍后启动......!!!" echo. omnifs delete %v_part%:\vhdos\%SYS%\%SYS%_child.vhd >nul omnifs copy %v_part%:\vhdos\%SYS%\%SYS%_bak.vhd %v_part%:\vhdos\%SYS%\%SYS%_child.vhd goto end :end quit.com r ============================================ |
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.