Batch Script – Device Console
Last Updated :
20 Mar, 2025
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
Function 2: DevCon DriverFiles operation
It helps in the listing of file names of drivers in the system devices.
devcon driverfiles * > driverfiles.txt
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
Function 4: Enables all printer devices
It is used to specify the Printer setup class.
devcon /r enable = Printer
Function 5: Re-scan
It is used to re-scan the computer for new devices.
devcon rescan
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.
Similar Reads
Batch Script - Echo Command
Batch script is a type of scripting language used in Windows operating systems to automate repetitive tasks, perform system administration functions, and execute a series of commands. The echo command is one of the most commonly used commands in batch scripting, used to display text or messages on t
8 min read
Batch Script - Remove Both Ends
In this article, we are going to learn how to remove characters from both ends of any given string using Batch Script. Code :@echo off set str=Geeks for Geeks echo %str% set str=%str:~1,-1% echo %str% pauseBy using ' set ' we are getting input of any stringset str=input stringIn the next line using
1 min read
Batch Script - Debugging
Batch Script is a text file that includes a definite amount of operations or commands that are performed in order. It is used in system networks as well as in system administration. It also eliminates a specific repetitive piece of work in various Operating Systems like DOS(Disk Operating System). D
3 min read
Batch Script - Logging
Batch Script is a file that consists of various commands which need to be sequentially executed. It is not like coding and is not frequently used, in order to communicate with the OS through a command prompt, the user can use Batch Script. The commands are known as Batch commands. Logging refers to
2 min read
Batch Script - Process in Linux
A Batch Script is basically a script having commands which execute sequentially. It helps users to perform repetitive tasks without human or user intervention or input. To automate some tasks like loading processes, and killing processes. Now in this article, we will write a batch script to view all
2 min read
Batch Script - Create String
In this article, we are going to learn how to create a String using Batch Script. Batch Script :@echo off set str=Geeks for Geeks echo %str% pauseBy using ' set ' we are getting input of any string.Ex: set str=input stringIn the next line, we are using ' echo %str% ' for printing our input string.Th
1 min read
Batch Script - String Concatenation
String Concatenation is combining two or more strings to create a new string. For instance, let a string "Good" and take another string "Morning" now by string concatenation i.e. "Good" + "Morning" and we got new string i.e. "Good Morning". This is string concatenation. Let see some examples of stri
2 min read
Batch Script - Input / Output
In this article, we are going to learn how to take input from users using Batch Script. Taking User Input:@echo off echo Batch Script to take input. set /p input= Type any input echo Input is: %input% pauseExplanation :The first 'echo' command is used to print a string.In the next line, 'set /p' com
1 min read
Batch Script - Printing / NETPrint Command
A Bash script is similar to a simple text file that contains a number of commands that the programmer can write in a command line. In Unix-based systems, these commands are used for performing repetitive tasks. A Bash script consists of a bunch of commands, or it may contain elements like loops, fun
3 min read
How To Embed Python Code In Batch Script
Embedding Python code in a batch script can be very helpful for automating tasks that require both shell commands and Python scripting. In this article, we will discuss how to embed Python code within a batch script. What are Batch Scripts and Python Code?Batch scripts are text files containing a se
4 min read