Topic: Proper driver prepping for W7
I have been working on this for my own personal DVD for quite some time. Downloading the drivers (using video as an example) and simply uncompressing to a folder will not work if you are planning on injecting them into your W7 image. DISM will fail on /add-driver.
In any case, you must use EXPAND all files ending with an underscore character ( _ ) while leaving the underscore intact.
In my case, I'm downloading a new nVidia package every few months (amongst others) and so I am constantly having to expand these. I've created a batch that makes this effortless so feel free to use. Remember to expand your install.exe into a folder and run the batch against it (changing the directory names to reflect yours). Copy and paste to notepad and save as filename.bat. You may then properly run DISM on the drivers.
This has been tested on nVidia and ATI...working.
REM @echo off
REM Batch file for conversion/expansion of any driver files that do not cooperate with Windows 7 DISM ADD-DRIVER due to compression.
REM This will also parse subdirectories and expand those files as well.
REM For visual confirmation, be sure to refresh your directory to view correct file sizes.
REM Location of original driver directory (user defined, don't forget trailing backslash)
SET DRVDIR=E:\VISTA\DRIVERS\nvidia
REM Wildcard pattern to search for compressed files (this example for nvidia, NVAPI.DL_)
SET WILDCARD=*.??_
REM Holds directory\filename of original compressed files (user defined, may be left unchanged)
SET DRIVERS=C:\DRVORG.TXT
REM Holds directory\filename of expanded files (user defined, may be left unchanged)
SET EXPANDED=C:\DRVEXP.TXT
REM Creates log of commands
SET LOG=C:\COOLLOG.TXT
REM Pre-Cleanup
DEL %EXPANDED% /q
DEL %DRIVERS% /q
DEL %LOG% /q
REM Creates standard text file with directory\filename of compressed files
for /f "tokens=1,2,3,4,5 delims= " %%A in ('dir /b /s %DRVDIR%%WILDCARD%') do echo %%A >> %DRIVERS%
REM Creates second standard text file with directory\filename of expanded files (minus the third ext character (underscore))
for /f "tokens=1,2,3,4,5 delims=_" %%A in ('dir /b /s %DRVDIR%%WILDCARD%') do echo %%A >> %EXPANDED%
REM Expands files to same directory (expanded files now have only two character extension)
for /f "tokens=1,2,3,4,5 delims= " %%A in ('type %DRIVERS%') do EXPAND.EXE -R %%A >> %LOG%
REM Overwrites original files
for /f "tokens=1,2,3,4,5 delims= " %%A in ('type %EXPANDED%') do MOVE /Y %%A %%A_ >> %LOG%
REM Cleanup
DEL %EXPANDED% /q
DEL %DRIVERS% /q
REM Present log file
CALL NOTEPAD.EXE %LOG%
EXIT
Last edited by razormoon (2009-08-29 09:04:08)
The preceding sentence is true.