The following command uses the DevCon DriverFiles operation to list the file names of drivers that devices on the system use. The command uses the wildcard character (*) to indicate all devices on the system. Because the output is extensive, the command uses the redirection character (>) to redirect the output to a reference file, driverfiles.txt.
The following command uses the DevCon DriverFiles operation to search for the device driver that the mouse device on the local computer uses. It identifies the device by one of its hardware IDs, HID\Vid_045e&Pid_0039&Rev_0121. The hardware ID is enclosed in quotation marks because it includes the ampersand character (&).
Acpi Pnp0700 Driver 12 1
The following command uses the DevCon DriverNodes command and an ID pattern to list the driver nodes of software-enumerated devices. Patterns are useful for finding information about similar devices that might not be in the same setup class.
The following command uses the DevCon DriverNodes operation to list the driver packages of all devices whose device instance IDs begin with ROOT\MEDIA, that is, devices in the Enum\Root\Media registry subkey. The command uses the at character (@) to indicate that the phrase is in the device instance ID.
The following command uses the DevCon Stack operation to search for devices in the Volume setup class and display the expected driver stack for those devices. The equal sign (=) indicates that the string is a class name.
In response, DevCon displays the expected stack for the devices in the Volume class. The returned data includes the device instance ID and description of each device, the GUID and name of the device setup class, the names of upper and lower filter drivers, and controlling services (if any).
The DevCon Stack operation returns the setup class of a device in addition to the upper and lower filter drivers. The following commands find the setup class of the printer port interface by finding its device instance ID and then using the device instance ID to find its setup class.
The following command uses the DevCon Stack operation to display the expected stack for miniport driver devices. It searches for devices in the Net setup class that have "miniport" in their hardware ID or compatible ID.
The following command uses the DevCon Find operation to search for mouse devices. Specifically, the command searches the computer for devices whose hardware ID or compatible ID includes "mou.", and would not find a "moose" driver.
Because all DevCon display operations also find hardware IDs, you can use any display operation to search for hardware IDs. Select the operation based on the content that you need in the output. For example, to find the device drivers that mouse-related devices on a local computer use, submit the following command.
The first command finds legacy drivers by a device instance ID pattern. The ID pattern is prefaced by the at character (@) to indicate a device instance ID and followed by the wildcard character (*) to find all devices in the ROOT\Legacy subkey.
In response, DevCon lists the following seven devices in the Net setup class. The first six are standard miniport driver devices. The seventh device, the RAS async adapter, is a software-enumerated device (SW\*) that is not installed until it is needed.
The following command uses the DevCon ClassFilter operation to display the upper filter drivers for the DiskDrive setup class. Because this command includes no classfilter operators, DevCon displays the filter drivers for the class, but does not change them.
In response, DevCon displays the upper filter drivers for the DiskDrive class and confirms that it did not change them. In this case, the display shows that devices in the DiskDrive setup class use the PartMgr.sys upper filter driver.
When the command starts, the virtual cursor is positioned before the first filter driver. Because it is not positioned on a particular driver, DevCon adds the Disklog driver to the end of the filter driver list.
If you misspell the driver name, or try to add a driver that isn't installed on the system, the command fails. DevCon does not add a driver unless the driver is registered as a service, that is, unless the driver has a subkey in the Services registry subkey (HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services).
The following command uses the DevCon ClassFilter operation to add a fictitious filter driver, MyFilter.sys, to the list of upper filter drivers for the DiskDrive setup class. The command places MyFilter.sys between PartMgr.sys and Disklog.sys in the load order.
The first subcommand, @Disklog, uses the positioning operator (@) to place the virtual cursor on the Disklog filter driver. The second subcommand, -MyFilter, uses the add-before operator (-) to add MyFilter.sys before Disklog.sys.
The positioning operator is essential in this example. Before DevCon processes any classfilter subcommands, the virtual cursor is at the beginning of the list and is not positioned on any filter drivers. If you use the add-before (+) operator when the cursor is not on positioned on a driver, DevCon adds the driver to the beginning of the list. If you use the add-after (-) operator when the cursor is not positioned on a driver, it adds the driver to the end of the list.
You can also use the following command to add the MyFilter driver and to place it between PartMgr and Disklog. In this example, the first subcommand, @PartMgr, positions the virtual cursor on the PartMgr filter driver. The second subcommand, +MyFilter, uses the add-after operator (+) to add MyFilter.sys after PartMgr.
The following command uses the DevCon ClassFilter operation to replace the original copy of MyFilter.sys with a new and improved version, MyNewFilter.sys, in the list of filter drivers for the DiskDrive setup class.
The first subcommand uses the delete operator (!) to delete MyFilter from the list of upper filter drivers for the DiskDrive class. (It does not affect the MyFilter.sys file in the C:\Windows\System32\Drivers directory.)
The second subcommand uses the add-after operator (+) to place the new filter driver in the position that the deleted driver occupied. Because the delete operator leaves the cursor in the position that the deleted filter occupied, the add-before (-) and add-after (+) operators have the same effect.)
The following command uses the DevCon ClassFilter operation to change the order of filter drivers for the DiskDrive setup class. Specifically, it reverses the order of the second and third filter drivers.
The first subcommand uses the delete operator (!) to delete Disklog from the list. The second subcommand uses the start operator (=) to move the virtual cursor back to the starting position and then uses the positioning operator (@) to place the cursor on the PartMgr driver. The start operator is necessary because the virtual cursor moves only forward through the list. The final subcommand uses the add-after operator (+) to add Disklog after PartMgr.
The following command uses the DevCon Update operation to replace the current device driver for communication ports on the system with a test driver specified in the test.inf file. The command affects only devices whose entire hardware ID is *PNP0501 (including the asterisk).
In response, DevCon displays a Hardware Installation warning explaining that the driver has not passed Windows Logo testing. If you select the Continue Anyway button on the dialog box, the installation continues.
You can also use the DevCon UpdateNI operation, the noninteractive version of the DevCon Update operation, to update drivers. The DevCon UpdateNI operation is identical to the DevCon Update operation except that it suppresses all user prompts that require a response and assumes the default response to the prompt.
In this case, DevCon does not display the Hardware Installation warning. Instead, it assumes the default response, Stop Installation. As a result, DevCon cannot update the drivers and displays a failure message.
The following command uses the DevCon Remove operation to uninstall the NDISWAN miniport driver from the local computer. The command specifies the Net class and then refines the search by specifying devices in the class whose hardware ID or compatible ID include "ndiswan." The command also includes the /r parameter, which reboots the system if rebooting is required to make the remove procedure effective.
The first command uses the DevCon SetHwID operation to change the hardware ID of the HAL from acpiapic_up, the hardware ID for uniprocessor HALs, to acpiapic_mp, the hardware ID for multiprocessor HALs.
You must change the hardware ID because the INF file for the HAL includes drivers for both uniprocessor and multiprocessor HALs. The system selects the most appropriate driver from the INF file based on the hardware ID of the device. If you do not change the hardware ID, then the DevCon Update command would simply reinstall the uniprocessor HAL driver.
In the following command, the command identifies the HAL by its instance ID, ROOT\ACPI_HAL\0000, as indicated by the @ character preceding the ID. The command uses the + character to make acpiapic_mp the first hardware ID in the list for the HAL. Then, it uses the ! character to delete the acpiapic_up hardware ID from the list of IDs for the HAL. 2ff7e9595c
Comments