How to Automate .inf PnP Windows 7 Drivers with Wildcard?
- by Dos_Probie
I am trying to automate the PnP driver installs for Windows 7
with either of the below batch files via For loop and wildcard for
the .inf file.
The rundll32 batch reads and echos the correct .inf file
but then gives me the "Error Installation failed" and with the pnputil
batch it runs without any error put does not install.
How can I correct the batch files to install the inf correctly?
@echo off&color a&setlocal enabledelayedexpansion
cd %~dp0
set PnP=rundll32 syssetup,SetupInfObjectInstallAction DefaultInstall 128 .\*.inf
for /f "delims=" %%a in ('dir/b %PnP%') do (
echo == Installing PnP Drivers == "%%a"
::or
set PnP=pnputil -i -a "*.inf"
for /f "delims=" %%a in ('dir/b %PnP%') do (
echo == Installing PnP Drivers == "%%a"
ping -n 3 localhost 1>nul
start "" /wait %PnP%\%%a
)
cls
echo. * DONE *
pause
exit