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:

  1. Click on Start.
  2. Select Run.
  3. Type regedit and hit Enter.
  4. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

    Regedit - DevicePath

  5. Double-click on DevicePath in the right-pane of the regedit window.

    Regedit - DevicePath value data

    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:

  1. Boot Windows PE on the device.
  2. At the command prompt, type regedit.
  3. Click HKEY_LOCAL_MACHINE.
  4. 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.

  5. In the Files of type box, select All Files.
  6. Navigate to the registry location on your target device.

    For example, if Windows is on drive C, navigate to C:\WINDOWS\system32\config.

  7. 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.
  8. In the Load Hive dialog box type a Key Name. For example, Examining (this can be just about any name you prefer).
  9. Choose HKEY_LOCAL_MACHINE, and then choose the new registry key you created, e.g. HKEY_LOCAL_MACHINE\Examining\Microsoft\Windows\CurrentVersion.
  10. Regedit - DevicePath for
C:\Windows

  11. In the right pane of the Registry Editor Window, double-click on DevicePath to view the value or change it.

    Regedit - DevicePath value 
for C:\Windows

    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.

  12. When you are finished, choose HKEY_LOCAL_MACHINE and the key you created within it, e.g. HKEY_LOCAL_MACHINE\Examining.
  13. 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:

  1. Device driver
    Wikipedia, the free encyclopedia
  2. 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
  3. INF file
    Wikipedia, the free encyclopedia
  4. File Extension .INF Details
    FILExt - The File Extension Source
  5. 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
  6. SYS File Extension
    FileInfo.com - The File Extensions Resource
  7. Editing the Registry Hive For Your Image on the Target Device
    Microsoft Developer Network (MSDN)