无忧启动论坛

标题: pecmd怎么加载驱动 [打印本页]

作者: fenghao    时间: 2019-9-10 14:50
标题: pecmd怎么加载驱动
驱动打包成wim格式怎么用pecmd加载或者有什么办法加载外置的驱动。比如吧drive.wam放在pesoft文件夹内
作者: fenghao    时间: 2019-9-10 14:53
或者打包成7z格式,怎么提取安装。。
作者: newyun    时间: 2019-9-10 15:59
FEXT &&ext=%1
FIND $cab=%&ext%, call handcab %1
FIND $7z=%&ext%, call hand7z %1
FIND $wim=%&ext%, call handwim %1
BROW Tag,x:\*.7z;*.cab;*.wim,请选择一个驱动包,cab或7z或wim驱动包|*.cab;*.7z;*.wim|
FEXT &&ext=%Tag%
FIND $cab=%&ext%, Call handcab "%Tag%"
FIND $7z=%&ext%, Call hand7z "%Tag%"
FIND $wim=%&ext%, Call handwim "%Tag%"

_SUB hwids
  exec* &&all=!devcon findall *
  READ  -,0,&&line,%&all%
  mstr &&Q=<1>%&line%
  ENVI-ret %1=%&Q%
_END

_SUB handcab
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
CALL hwids &&ID1
DEVI $%~1,
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, DEVI $%~1,
exit file
_END

_SUB hand7z
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
NAME &&fname=%~1
CALL hwids &&ID1
EXEC =!%programfiles%\7-zip\7z.exe x %1 -o%temp%\pe-driver\%&fname%
EXEC =!DPinst.exe /S /Path %temp%\pe-driver\%&fname%
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, EXEC -hide -wait DPinst.exe /S /Path %temp%\pe-driver\%&fname%
FILE %temp%\pe-driver
exit file
_END

_SUB handwim
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
NAME &&fname=%~1
CALL hwids &&ID1
RAMD ImDisk,L64,NTFS,,drvDisk,,1
MOUN %1,%CurRamDisk%\%&fname%,1
EXEC =!DPinst.exe /S /Path %CurRamDisk%\%&fname%
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, EXEC -hide -wait DPinst.exe /S /Path %CurRamDisk%\%&fname%
MOUN *u %1,%CurRamDisk%\%&fname%
WAIT 200
RAMD ImDisk* -d -m %CurRamDisk%
exit file
_END


这是我从别人pe里面抄过来的,,,你自己注意改下7z.exe,,DPinst.exe的路径
作者: fenghao    时间: 2019-9-10 16:58
newyun 发表于 2019-9-10 15:59
FEXT &&ext=%1
FIND $cab=%&ext%, call handcab %1
FIND $7z=%&ext%, call hand7z %1

好的,谢谢,我测试一下

作者: fenghao    时间: 2019-9-11 13:13
newyun 发表于 2019-9-10 15:59
FEXT &&ext=%1
FIND $cab=%&ext%, call handcab %1
FIND $7z=%&ext%, call hand7z %1

哎一直失败。 难道我改错了?
我吧文件放在%CurDir%\drive.7z
命令改了好多次
最后改成
FEXT &&ext=%1
FIND $cab=%&ext%, call handcab %1
FIND $7z=%&ext%, call hand7z %1
FIND $wim=%&ext%, call handwim %1
BROW Tag,x:\PESOFT\drives.7z
FEXT &&ext=%%CurDir%\drives.7z%
FIND $cab=%&ext%, Call handcab "%Tag%"
FIND $7z=%&ext%, Call hand7z "x:\PESOFT\drives.7z"
FIND $wim=%&ext%, Call handwim "%Tag%"

_SUB hwids
  exec* &&all=!devcon findall *
  READ  -,0,&&line,%&all%
  mstr &&Q=<1>%&line%
  ENVI-ret %1=%&Q%
_END

_SUB handcab
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
CALL hwids &&ID1
DEVI $%~1,
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, DEVI $%~1,
exit file
_END

_SUB hand7z
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
NAME &&fname=%~1
CALL hwids &&ID1
EXEC =!%programfiles%\7-zip\7z.exe x %1 -o%temp%\pe-driver\%&fname%
EXEC =!DPinst.exe /S /Path %temp%\pe-driver\%&fname%
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, EXEC -hide -wait DPinst.exe /S /Path %temp%\pe-driver\%&fname%
FILE %temp%\pe-driver
exit file


_SUB handwim
TEAM TEXT   正在安装驱动,请稍等……$15|WAIT 100
NAME &&fname=%~1
CALL hwids &&ID1
RAMD ImDisk,L64,NTFS,,drvDisk,,1
MOUN %1,%CurRamDisk%\%&fname%,1
EXEC =!DPinst.exe /S /Path %CurRamDisk%\%&fname%
WAIT 500
CALL hwids &&ID2
find |%&ID1%<%&ID2%, EXEC -hide -wait DPinst.exe /S /Path %CurRamDisk%\%&fname%
MOUN *u %1,%CurRamDisk%\%&fname%
WAIT 200
RAMD ImDisk* -d -m %CurRamDisk%
exit file
_END
作者: newyun    时间: 2019-9-12 11:49
fenghao 发表于 2019-9-11 13:13
哎一直失败。 难道我改错了?
我吧文件放在%CurDir%\drive.7z
命令改了好多次

不要改试试,,7z文件放到当前目录
作者: fenghao    时间: 2019-9-12 13:06
newyun 发表于 2019-9-12 11:49
不要改试试,,7z文件放到当前目录

不改也一样没用。




欢迎光临 无忧启动论坛 (http://wuyou.net./) Powered by Discuz! X3.3