In my recent struggles with using the Windows 7/8 PNPUtil.exe built-in utility, I went on a search for another means to handle installing my Plug and Play drivers. I’ve dabbled with the Devcon.exe utility in the past, but it is mostly meant for use with Windows XP and previous OSes. I then came across a utility that I’ve seen many times before. The DPInst.exe utility is one used by manufacturers for importing their drivers during installation. It is by far the most flexible and powerful utility of them all. Here is how I’ve come to use the utility and am very happy with the results.
Script I use to call the proper DPInst.exe utility (x86 or x64):
@echo off If "%PROCESSOR_ARCHITECTURE%" EQU "x86" ( If exist "%SystemRoot%\SysWOW64" ( "%SystemRoot%\sysnative\cmd.exe" /C "%~dpnx0" %1 %2 %3 %4 %5 %6 %7 %8 %9 exit ) ) echo Changing Directory to "%~dp0" > log.txt cd /d "%~dp0" If exist "%SystemDrive%\Program Files (x86)" ( echo Begining to execute DPInst64 >> log.txt "%~dp0dpinst64.exe" /c >> log.txt ) else ( echo Begining to execute DPInst32 >> log.txt "%~dp0dpinst32.exe" /c >> log.txt ) echo Processing is complete. >> log.txt echo Review the "%systemroot%\DPINST.LOG" for more information. >> log.txt
Both the x86 and x64 versions can use the same DPInst.XML, which MUST be placed in the same directory as the .EXE files:
* Settings for XML can be found here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff553383(v=vs.85).aspx
<?xml version="1.0" ?> <dpinst> <search> <subDirectory>*</subDirectory> </search> <enableNotListedLanguages/> <suppressEulaPage/> <suppressWizard/> <quietInstall/> <suppressAddRemovePrograms/> <!-- Only install drivers for online hardware --> <scanHardware/> <!-- No driver signature required --> <legacyMode/> <!-- Force driver install even if current is better --> <forceIfDriverIsNotBetter/> </dpinst>
Lastly, I toss all of my drivers in sub-folders. DPInstall is smart enough to re-curse through the directory tree and also install ONLY the drivers it needs (Matches a PNPID installed on the system).
It has exhibited issues installing Bluetooth and USB 3.0 drivers, but I believe that is because those devices have multiple sub-devices that appear after the initial driver is installed.
Download of DPInst.zip.
/Brian G
good day to you from germany. i found your publishing very useful. I have virtualbox(oracle), xp installed in virtualbox. i used your scriipt for this xp. I want to install, hp photosmart Dia Scanner – C5101A – S20 Driver ( ps804(ps804mu.exe) ). it has .dll, .inf , etc ) . dpinst.exe cannot install this Driver. from dpinst.log —
Preinstalling ‘c:\\windows\system32\drivers\hpi_usb2.inf’ …
INFO: ENTER: DriverPackagePreinstallW
INFO: Looking for Model Section [eTEK]…
INFO: No matching devices found in INF “c:\windows\system32\drivers\hpi_usb2.inf” on the Machine.
INFO: RETURN: DriverPackagePreinstallW (0xE000020B)
—
INFO: Preinstalling ‘c:\ps804\drivers\win95\hpi_usbg.inf’ …
INFO: ENTER: DriverPackagePreinstallW
ERROR: hpi_usbg.inf: Driver package ‘c:\ps804\drivers\win95\hpi_usbg.inf’ has no CatalogFile entry.
INFO: RETURN: DriverPackagePreinstallW (0x800B0100)
—
Perhaps, you can help me. i would be very glad, if you send me a email. best regards,
Raja,
Is it possible for you to use the HP Universal Driver? http://h20564.www2.hp.com/hpsc/swd/public/readIndex?sp4ts.oid=4157320
That is what I try to use whenever possible.
-BG