rem 该文件统一以U盘的“\MiniPE\PE”文件(即毛桃的0911的WinPE镜像定义文件)作为标准 rem 它是一个文本文件,要启动各种PE均可修改这一个文件即可,因此镜像和winpe.ini文件可以放到其他目录。 rem 本文件调用的“COPYPE”为自编的一个文件,功能为从当前盘的PE读其中定义的PE镜像包位置, rem 再从传递给它的U盘参数将文件准备到软盘中,实际上就是准备存放包的目录和拷贝winpe.ini文件
cls path a:\ echo Searching USB DEVICE...... set UDrv= set PeFlag=minipe\pe rem 找PeFlag文件就代表找到U盘 if exist z:\%PeFlag% set UDrv=z: IF not "%UDrv%"=="" GOTO ufind if exist y:\%PeFlag% set UDrv=y: IF not "%UDrv%"=="" GOTO ufind if exist x:\%PeFlag% set UDrv=x: IF not "%UDrv%"=="" GOTO ufind if exist w:\%PeFlag% set UDrv=w: IF not "%UDrv%"=="" GOTO ufind if exist v:\%PeFlag% set UDrv=v: IF not "%UDrv%"=="" GOTO ufind if exist u:\%PeFlag% set UDrv=u: IF not "%UDrv%"=="" GOTO ufind if exist t:\%PeFlag% set UDrv=t: IF not "%UDrv%"=="" GOTO ufind if exist s:\%PeFlag% set UDrv=s: IF not "%UDrv%"=="" GOTO ufind if exist r:\%PeFlag% set UDrv=r: IF not "%UDrv%"=="" GOTO ufind if exist q:\%PeFlag% set UDrv=q: IF not "%UDrv%"=="" GOTO ufind if exist p:\%PeFlag% set UDrv=p: IF not "%UDrv%"=="" GOTO ufind if exist o:\%PeFlag% set UDrv=o: IF not "%UDrv%"=="" GOTO ufind if exist n:\%PeFlag% set UDrv=n: IF not "%UDrv%"=="" GOTO ufind if exist m:\%PeFlag% set UDrv=m: IF not "%UDrv%"=="" GOTO ufind if exist l:\%PeFlag% set UDrv=l: IF not "%UDrv%"=="" GOTO ufind if exist k:\%PeFlag% set UDrv=k: IF not "%UDrv%"=="" GOTO ufind if exist j:\%PeFlag% set UDrv=j: IF not "%UDrv%"=="" GOTO ufind if exist i:\%PeFlag% set UDrv=i: IF not "%UDrv%"=="" GOTO ufind if exist h:\%PeFlag% set UDrv=h: IF not "%UDrv%"=="" GOTO ufind if exist g:\%PeFlag% set UDrv=g: IF not "%UDrv%"=="" GOTO ufind if exist f:\%PeFlag% set UDrv=f: IF not "%UDrv%"=="" GOTO ufind if exist e:\%PeFlag% set UDrv=e: IF not "%UDrv%"=="" GOTO ufind if exist d:\%PeFlag% set UDrv=d: IF not "%UDrv%"=="" GOTO ufind if exist c:\%PeFlag% set UDrv=c: IF not "%UDrv%"=="" GOTO ufind if exist b:\%PeFlag% set UDrv=b: IF not "%UDrv%"=="" GOTO ufind if exist a:\%PeFlag% set UDrv=a: IF not "%UDrv%"=="" GOTO ufind GOTO ERR_FindUDrv
:ufind a: cd\ if not exist grub.exe copy %UDrv%\boot\grub\grub.exe cd minipe rem 以U盘的minipe中的PE作标准配置位置 copy %UDrv%\minipe\pe
rem 准备PE镜像和Winpe.ini文件 copype %UDrv% cd\
rem 用grub.exe来链式装载PE grub.exe --config-file="root (fd0);chainloader (fd0)/ldrxpe" goto end
:ERR_FindUDrv cls echo USB Device Not Found. goto end