Open In App

Batch Script – Device Console

Last Updated : 01 May, 2022
Improve
Improve
Like Article
Like
Save
Share
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

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads