Open In App

Batch Script – Device Console

Last Updated : 20 Mar, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

A batch script is a text file that includes various sequential commands. It is used to evaluate repetition routines in Windows,  OS/2, and DOS operating systems and is used in network and system administration. A batch file refers to a file that stores command in a serial order.  The library has been modified by Windows which can be used in Batch Script for coordination with the system devices. This is called a device console (DevCon.exe). The developer can easily use the DevCon to check the installation and configuration of a driver, which includes the INF files(driver package). Users can also perform installation, start, stop, etc. in scripts to test the driver files. It is a command-line tool that executes device management on the computer system. 

DevCon kit can be located on the given below location after getting installed.

%WindowsSdkDir%\tools\x64\devcon.exe
%WindowsSdkDir%\tools\x86\devcon.exe
%WindowsSdkDir%\tools\arm\devcon.exe

Features of  DevCon

  • Descriptive driver packages.
  • Show device status.
  • INF files.
  • Compatibility along with device setups.
  • Perform Enable and Disable functions of a device.
  • Search for devices and IDs(hardware IDs, device instance IDs, etc).

Syntax of DevCon command:

devcon [/m:\\computer] [/r] command [arguments]

Various commands of DevCon to perform different  functions

Function 1: DevCon status operation

 It is used to find the status of all the devices on a local computer.

devcon status * > status.txt
DevCon status operation

 

Function 2: DevCon DriverFiles operation

 It helps in the listing of file names of drivers in the system devices.

devcon driverfiles * > driverfiles.txt
DevCon DriverFiles operation

 

Function 3: DevCon Install operation

 Given below command is used to install the devices on a local computer.

devcon /r install c:\windows\inf\keyboard.inf *PNP030b

DevCon Install operation

 

Function 4: Enables all printer devices

It is used to specify the Printer setup class.

devcon /r enable = Printer
Enables all printer devices

 

Function 5: Re-scan 

It is used to re-scan the computer for new devices.

devcon rescan
Re-scan

Conclusion

Batch scripting and DevCon (Device Console) are useful utilities to automate device management and system administration on Windows. With DevCon commands, administrators can easily install, enable, disable, and debug drivers without the graphical user interface. It is useful particularly for IT staff, network administrators, and programmers dealing with multiple devices.

Since DevCon.exe is a command-line application, it has higher flexibility to do scripting and automating and so it’s one of the unavoidable tools for IT engineers and system administrators. For those working in Windows device administration, knowing how to script by using batch in DevCon may save time and make it more convenient to run operations.



Next Article
Article Tags :

Similar Reads