Determining Device Driver Locations Used During Setup
To determine the directories used by Microsoft Windows XP, and perhaps
other versions of Windows, to locate
device drivers during setup of Windows, you can check the registry key
HKLM\Software\Microsoft\Windows\CurrentVersion\DevicePath. That
registry key indicates where Windows can find
INF files,
which are plaintext files that can be viewed in Notepad, that
specify which device drivers to load. The device driver files themselves are
usually .sys files on
Windows systems.
To check the registry key, take the following steps within Microsoft
Windows:
- Click on Start.
- Select Run.
- Type regedit and hit Enter.
- Navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
- Double-click on DevicePath in the right-pane of the regedit
window.
You will then see something similar to the following, which shows
which directories Windows will check for INF files that it uses
to load device drivers:
Value name: | DevicePath |
Value data: | %SystemRoot%\Driver Cache;%SystemRoot%\inf |
In the example above the directories that Windows will use are
%SystemRoot%\Driver Cache;%SystemRoot%\inf. You can find
the value for %SystemRoot% on a particular system by
getting a command prompt (Start, All Programs,
Accessories, and Command Prompt on Windows XP) and typing
echo %systemroot%. On a Windows XP system, the value for
the %systemroot% variable will typically be
C:\WINDOWS. So in this case Windows
will check the following directories for INF files for device drivers.
C:\Windows\Driver Cache
C:\Windows\inf
On another system, it may also be checking additional directories.
You can also determine this value without being booted into the version
of Windows on the system's hard drive by using a
Bart's Preinstalled Environment (BartPE)
bootable live windows CD/DVD boot disc by taking the steps below.
To check the registry key within BartPE, take the following
steps:
- Boot Windows PE on the device.
- At the command prompt, type regedit.
- Click HKEY_LOCAL_MACHINE.
- From the File menu, choose Load Hive.
A series of message boxes may appear that state that the folder cannot be
found and that the location is unavailable. Ignore these messages and click
OK when they appear.
The Load Hive dialog box appears.
- In the Files of type box, select All
Files.
- Navigate to the registry location on your target device.
For example, if Windows is on drive C, navigate to
C:\WINDOWS\system32\config.
- In the config folder, select the hive you want to edit, in
this case SOFTWARE (choose "SOFTWARE", not "SOFTWARE.SAV"
or "SOFTWARE.LOG") and then choose OK.
- In the Load Hive dialog box type a Key Name. For
example, Examining (this can be just about any name
you prefer).
- Choose HKEY_LOCAL_MACHINE, and then choose the new
registry key you created, e.g.
HKEY_LOCAL_MACHINE\Examining\Microsoft\Windows\CurrentVersion.
- In the right pane of the Registry Editor Window, double-click on
DevicePath to view the value or change it.
In the example above, I found the following "value data" for
DevicePath:
%SystemDrive%\drivers;%SystemRoot%\inf;c:\drivers\storage;c:\drivers\system;c:\drivers\video;c:\drivers\AUDIO;c:\drivers\NETWORK;c:\drivers\NETWORK\ONBOARD;c:\drivers\MODEM;c:\drivers\MODEM\ADDON;c:\drivers\PRINTER;c:\drivers\PRINTER\A960
In this case %systemdrive% was C:\
and %systemroot% was C:\Windows. Within
the C:\drivers directory were a lot of subdirectories
containing INF files for device drivers.
- When you are finished, choose HKEY_LOCAL_MACHINE
and the key you created within it, e.g.
HKEY_LOCAL_MACHINE\Examining.
-
Choose the File menu, and then choose Unload
Hive When prompted as to whether you are sure you want to
unload the current key and all of its subkeys, choose Yes.
References:
-
Device driver
Wikipedia, the free encyclopedia
-
How to Add OEM Plug and Play Drivers to Windows XP
Article ID: 314479
Last Review: May 23, 2003 - Revision: 2.2
Microsoft Help and Support
-
INF file
Wikipedia, the free encyclopedia
-
File Extension .INF Details
FILExt - The File Extension Source
-
Setup Manager Incorrectly Writes the OEMPnpDriversPath Line in the Sysprep.inf
File
Article ID: 250498
Last Review: March 1, 2007 - Revision: 3.2
Microsoft Help and Support
-
SYS File Extension
FileInfo.com - The File Extensions
Resource
-
Editing the Registry Hive For Your Image on the Target Device
Microsoft Developer Network (MSDN)