|
本帖最后由 D_M_GuYing 于 2022-11-4 05:56 编辑
VM下,测试,光驱启动,我的C盘下,并没有WEPE.WIM,文件在ESP分区里
我也在试图解决这个问题,不过我的功底和你没法儿比,只是用最笨的方法,读取注册表后,最笨的方法得到硬盘的信息,例如
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control
SystemStartOptions REG_SZ NOEXECUTE=OPTIN PAE MININT FVEBOOT=2658304 RDIMAGEOFFSET=8192 RDIMAGELENGTH=971264 RDPATH=MULTI(0)DISK(0)RDISK(0)PARTITION(1)\WEPE\WEPE64.WIM
然后,用DISK参数,把DISK(0)RDISK(0)PARTITION(1)卸载再分配盘符,以达到分配隐藏分区的目的,定位后挂载外置
这是我PE下的代码,在你面前班门弄斧,实在是浅显,不要笑话我。只是想提个思路,期待完美解决这个问题
PECMD.INI中的代码
--------------------------------------------------------------------
//查找并分配外置所在的隐藏分区
IFEX %ProgramFiles%\WEPE.INI,ENVI wzPath=%ProgramFiles%\WEPE.INI!CALL FINDFZ
FDIR wimPath=%wzPath%
_SUB FINDFZ
EXEC =!CMD /C REG QUERY HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ /v SystemStartOptions > %temp%\1.TXT
EXEC =!"%ProgramFiles%\SYS\disk.cmd"
IFEX %temp%\3.INI,
{
LOAD %temp%\3.INI
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%
}
_END
_SUB getNoDrv
ENVI nodrv=
IFEX W:,!ENVI nodrv=W:
IFEX V:,!ENVI nodrv=V:
IFEX U:,!ENVI nodrv=U:
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
=========================================================================
%ProgramFiles%\SYS\disk.cmd中的代码
@echo off&setlocal enabledelayedexpansion
set key=PARTITION(
(for /f "delims=" %%a in (%temp%\1.TXT) do (
set var=
set "str=%%a%key%"
for /l %%b in (1 1 100) do (
if defined str set str=!str:*%key%=!
for /f "delims=." %%c in ("!str!") do set var=!var!%%c.
)
echo;!var!
))>%temp%\2.TXT
for /f %%i in (%temp%\2.TXT) do (
set str=%%i
set str=!str:~0,1!
echo envi PARTITION=!str! >%temp%\3.INI
)
set key=RDISK(
(for /f "delims=" %%a in (%temp%\1.TXT) do (
set var=
set "str=%%a%key%"
for /l %%b in (1 1 100) do (
if defined str set str=!str:*%key%=!
for /f "delims=." %%c in ("!str!") do set var=!var!%%c.
)
echo;!var!
))>%temp%\2.TXT
for /f %%i in (%temp%\2.TXT) do (
set str=%%i
set str=!str:~0,1!
echo envi RDISK=!str! >>%temp%\3.INI
)
::pause
很笨也不是很全面的方法,请不要见笑哈【22.11.01】大漠孤鹰Win11PE_x64_APFS(双模启动,可安装到系统、隐藏分区、空硬盘) - PE作品发布区 - 无忧启动论坛 - Powered by Discuz! (wuyou.net)
|
|