Skip to content

Instantly share code, notes, and snippets.

@Lockyc
Forked from xee5ch/DriverImport.bat
Last active August 29, 2015 14:15
Show Gist options
  • Save Lockyc/2055e0bb10840963fbb4 to your computer and use it in GitHub Desktop.
Save Lockyc/2055e0bb10840963fbb4 to your computer and use it in GitHub Desktop.
@ECHO OFF
IF "%1" == "" GOTO ERROR
ECHO.
ECHO Checking dir %1 recursively for drivers.
ECHO.
FOR /F "tokens=*" %%D IN ('DIR /B /AD /S %1') DO PNPUTIL -a "%%D\*.inf" 2>&1 >> %WinDir%\system32\driverimport.log
GOTO EOF
:ERROR
ECHO Missing argument! Must include QUOTED directory path!
ECHO %0 "C:\path\to\driver\folder\"
:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment