DEVCON is a Microsoft tool that allows "device management" from the command line.
It is available for free from Microsoft Support.
This download page also provides detailed help.
More detailed information and command line examples can be found at Microsoft TechNet.
I dedicated this page to DEVCON because I became impressed by its possibilities.
It even allowed me to write scripts to backup drivers without having to search all INF files "manually".
This had been on my wish list for a long time.
Another great feature is DEVCON's built-in Reboot command.
Typing DEVCON help or DEVCON /?
returns the following help screen:
C:\>DEVCON Help
Device Console Help: devcon [-r] [-m:\\<machine>] <command> [<arg>...] -r if specified will reboot machine after command is complete, if needed. <machine> is name of target machine. <command> is command to perform (see below). <arg>... is one or more arguments if required by command. For help on a specific command, type: devcon help <command> classfilter Allows modification of class filters. classes List all device setup classes. disable Disable devices that match the specific hardware or instance ID. driverfiles List driver files installed for devices. drivernodes Lists all the driver nodes of devices. enable Enable devices that match the specific hardware or instance ID. find Find devices that match the specific hardware or instance ID. findall Find devices including those that are not present. help Display this information. hwids Lists hardware ID's of devices. install Manually install a device. listclass List all devices for a setup class. reboot Reboot local machine. remove Remove devices that match the specific hardware or instance ID. rescan Scan for new hardware. resources Lists hardware resources of devices. restart Restart devices that match the specific hardware or instance ID. stack Lists expected driver stack of devices. status List running status of devices. update Manually update a device.
Use DEVCON Help command for detailed help on command:
C:\>DEVCON Help DriverFiles
devcon driverfiles <id> [<id>...] devcon driverfiles =<class> [<id>...] Lists driver files installed for devices that match the specific hardware or instance ID. This command will only work for local machine. Examples of <id> are: * - All devices ISAPNP\PNP0501 - Hardware ID *PNP* - Hardware ID with wildcards (* matches anything) @ISAPNP\*\* - Instance ID with wildcards (@ prefixes instance ID) <class> is a setup class name as obtained from the classes command.
The table below lists some of my scripts based on DEVCON, along with the basic command line switches they use.
| DEVCON Script Examples | |||||
|---|---|---|---|---|---|
| Name | Description | Switches | Last Modified (dd/mm/yyyy) |
Remarks | |
| BkAllDrv.bat | Backup all Windows 2000 drivers | FindAll * DriverFiles "@hwid" |
10/01/2004 | The batch, KiXtart and Perl versions can also backup
inactive drivers. The batch and KiXtart versions are much slower. The batch, KiXtart and Rexx versions will prompt you to download DEVCON itself or RexxUtill (Rexx only) if missing. The Perl version creates a log file that may help in restores, and an error log, if applicaple. |
|
| BkAllDrv.kix | Backup all Windows 2000 drivers | FindAll * DriverFiles "@hwid" |
12/01/2004 | ||
| BkAllDrv.pl | Backup all Windows 2000 drivers | FindAll * DriverFiles "@hwid" |
14/02/2004 | ||
| BkAllDrv.rex | Backup all Windows 2000 drivers | DriverFiles * | 30/12/2003 | ||
| BkMdmDrv.rex | Backup Windows 2000 modem drivers | DriverFiles =Modem | 27/12/2003 | These scripts will prompt you for download if DEVCON isn't found. | |
| BkVidDrv.rex | Backup Windows 2000 video drivers | DriverFiles =Display | 28/12/2003 | ||
| Drivers.cmd | Display all active drivers (Windows as well as OS/2) | DriverFiles * | 21/09/2005 | Uses RMVIEW and CUT in OS/2 Warp | |
| ExpPrnDr.bat | Export Printer Drivers | DriverFiles =Printer | 16/12/2009 | This script will prompt you for download if DEVCON isn't found. | |
| GetDevDJ.bat | Check if a HP DeskJet printer is installed | Find * | 30/03/2002 | ||
| GetDevLT.bat | Check if a Logitech mouse is installed | Find * | 30/03/2002 | ||
| GetDevSB.bat | Check if a Creative Sound Blaster is installed | Find * | 30/03/2002 | ||
| HardDisk.bat | List harddisks, their interfaces and revision numbers for any computer on the network | Find =DiskDrive | 15/01/2005 | This script will prompt you for download if DEVCON isn't found. | |
| ListHDDs.bat | List all physical harddisk models on a remote PC | Find =DiskDrive SCSI\DISK* | 24/11/2009 | Requires either WMIC or DEVCON; if neither is available, you will be prompted to open the DEVCON download page | |
| Modems.bat | List all modems and the resources they use | Resources =Modem | 23/12/2003 | This script will prompt you for download if DEVCON isn't found. | |
| RenewUSB.bat | Remove all USB devices and then rescan for new ones | FindAll =USB FindAll USB* Remove "@hwid" Rescan |
11/06/2004 | Warning: May cripple your OS, use entirely at your own risk, and only after making a full backup. I had to run this script twice before my computer accepted my new USB stick. This script will prompt you for download if DEVCON isn't found. |
|
| RmHidDev.bat | Remove all hidden (inactive) plug&play devices | Find * FindAll * Remove "@hwid" |
10/11/2006 | Warning: May cripple your OS, use entirely at your own risk, and only after making a full backup. Written to remove "ghost devices" from Ghost images. This script will prompt you for download if DEVCON isn't found. |
|
| ShowPRN.bat | List all printers and their printer ports | FindAll =Printer | 17/01/2004 | These scripts will prompt you for download if DEVCON isn't found. | |
| ShowPRNT.bat | List all printers and their printer ports in tab delimited format | FindAll =Printer | 17/01/2004 | ||
| Examples of DEVCON commands: | ||
|---|---|---|
DEVCON Classes |
List all available classes; may come in handy if you want to start writing your own DEVCON batch files. | |
DEVCON DriverFiles =USB |
List drivers for all USB devices. | |
DEVCON Findall =USB |
List USB devices, even the ones that aren't currently connected (without the drivers, though). | |
DEVCON Reboot |
Reboot the computer. | |
DEVCON Status =Image |
List status of all active imaging devices. | |
FOR /F %%A IN ( |
List status of all imaging devices, including inactive ones. | |
| page last uploaded: 7 February 2013, 10:40 |