|
笨方法虽然不能面面俱到,但对我这个PE却管用,先不折腾了
//查找并分配外置所在的隐藏分区
IFEX %ProgramFiles%\WEPE.INI,ENVI wzPath=%ProgramFiles%\WEPE.INI!CALL FINDFZ
FDIR wimPath=%wzPath%
_SUB FINDFZ
REGI .HKLM\SYSTEM\CurrentControlSet\Control\SystemStartOptions,&sso
forx * %&sso% ,&p0,
{
envi &&item0=
mstr &&item0=0,7,%&p0%
Find $"%&item0%"="RDPATH=" ,
{
mstr RDISK=29,1,%&p0%
mstr PARTITION=41,1,%&p0%
mstr CDROM=23,5,%&p0%
}
}
FIND $%CDROM%=CDROM,!
{
DISK ,%RDISK%,%PARTITION%,1
CALL getNoDrv
DISK %nodrv%,%RDISK%,%PARTITION%,1
ENVI wzPath=%nodrv%\WEPE\WEPE.INI
IFEX %wzPath%,!
{
CALL getNoDrv
DISK %nodrv%,%RDISK%,2,1
ENVI wzPath=%nodrv%\WEPE\WEPE.INI
}
}
IFEX %wzPath%,!
{
FORX !\Setup\安装WinPE.CMD,STPATH,1,FDRV STPATH=%STPATH%
ENVI wzPath=%STPATH%\WEPE\WEPE.INI
}
IFEX %wzPath%,!
{
MOUN !\WEPE\WEPE.INI,X:\a,1
FILE X:\a
FORX !\WEPE\WEPE.INI,fPath,1,ENVI wzPath=%fPath%
}
IFEX %wzPath%,!
{
SHOW -1:-1
FORX !\WEPE\WEPE.INI,fPath,1,ENVI wzPath=%fPath%
}
EXEC =!CMD /C ECHO ENVI wzPath=%wzPath% > %temp%\wzPath.INI
_END
_SUB getNoDrv
ENVI nodrv=
IFEX W:,!ENVI nodrv=W:
IFEX V:,!ENVI nodrv=V:
IFEX T:,!ENVI nodrv=T:
IFEX S:,!ENVI nodrv=S:
IFEX R:,!ENVI nodrv=R:
IFEX Q:,!ENVI nodrv=Q:
IFEX P:,!ENVI nodrv=P:
IFEX O:,!ENVI nodrv=O:
IFEX N:,!ENVI nodrv=N:
IFEX M:,!ENVI nodrv=M:
IFEX L:,!ENVI nodrv=L:
IFEX K:,!ENVI nodrv=K:
IFEX G:,!ENVI nodrv=G:
IFEX I:,!ENVI nodrv=I:
IFEX H:,!ENVI nodrv=H:
IFEX G:,!ENVI nodrv=G:
IFEX F:,!ENVI nodrv=F:
IFEX E:,!ENVI nodrv=E:
IFEX D:,!ENVI nodrv=D:
IFEX C:,!ENVI nodrv=C:
_END
|
|