devcon update/remove命令(更新/安装/卸载驱动)
2021-09-08
1477
0
这里的inf文件为:pnpon.inf
硬件ID为:*PNPONVDualA
可根据需要自行修改
CD /d %~dp0
devcon.exe update pnpon.inf "*PNPONVDualA"
echo %errorlevel%
if %errorlevel% EQU 2 (devcon.exe install pnpon.inf "*PNPONVDualA")
循环测试安装卸载驱动:
CD /d %~dp0
:Start
devcon.exe update test.inf "USB\VID_1234&PID_0100"
ping -n 10 127.0.1>nul
devcon.exe remove "USB\VID_1234&PID_0100"
ping -n 5 127.0.1>nul
pnputil.exe /delete-driver oem71.inf
ping -n 5 127.0.1>nul
devcon.exe rescan
ping -n 10 127.0.1>nul
goto Start