Created
June 12, 2011 13:34
-
-
Save xee5ch/1021553 to your computer and use it in GitHub Desktop.
Recursively Check Folders for INF Files and Install Windows 7 PnP Drivers When Found
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
Note for those less familiar with DOS batch language: %1 refers to the first argument, meaning this script expects the parent path to be an argument to the script call. I just had to explain that to someone who wasn't up on batch files, so maybe this will save someone frustration some day.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@xee5ch I've found this by searching in Google.
Thanks man !