Enable/disable a device from the command line

It is possible to enable/disable devices from the command line in Windows XP, by managing internet connection, network cards and tuner cards. Download Devcon, locate it on the system folder, and install it. You can see all devices connected to the system and select any from the list to enable or disable using DevCon commands. Other devices like floppy disk, sound card, and video cards can be enabled/disabled. DevCon is a command-line utility that is alternative to Device Manager. DevCon enables, disables, restarts, updates, removes and queries individual or groups of devices. DevCon can get information related to the driver developer, unlike Device Manager. Devcon works with some Microsoft Windows operating systems, and not with Windows 95, 98, and ME versions.

Enable/disable a device from the command line



This article lets users enable/disable a tag from command line in a few easy steps.
The document shows how to carry out this activity on Windows XP by installing DevCon. The link to download this is provided in the article. This software displays all devices and thus the user can enable or disable a device according to his requirement. The commands for doing this are included in the article.

This allows you enable/disable your internet connection (or network card) on the command line.

Install DevCon

  • 1. To download, go to the Microsoft website: Link
  • 2. Once downloaded, unpack the file
  • 3. Copy \i386\devcon.exe to c:\windows\system32
  • 4. Locate the device that you want. In the command prompt type:
    devcon find *

Display all the devices in the system

  • In the command prompt, type
    devcon find *> list.txt 
    • To get the list in a file
  • For example, my network card Accton appears as:
    • PCI\VEN_1113&DEV_1211&SUBSYS_12111113&REV_10\3&13C0B0C5&0&48: Accton EN1207D Series PCI Fast Ethernet Adapter #2 


Choose a piece of the string that identifies the device, and verify it is unique:

c:\>devcon find *VEN_1113    
PCI\VEN_1113&DEV_1211&SUBSYS_12111113&REV_10\3&13C0B0C5&0&48: Accton EN1207D Ser    
ies PCI Fast Ethernet Adapter #2    
1 matching device(s) found.


Make sure that "VEN_1113" means a single network card.

Enable/disable the device


devcon disable *VEN_1113     
devcon enable *VEN_1113 


This allows me to enable/disable my network card (and therefore my internet connection) from the command line.

Other devices

  • The floppy disk drive is:
    • ACPI\PNP0700\3&13C0B0C5&0 : standard disk controller
  • To disable/enable it at will:
    • devcon disable * PNP0700 
    • This eliminates the floppy drive system!
  • To prevent your computer from beeping:
    • ROOT\LEGACY_BEEP\0000 : Beep
Published by deri58 - Last update on March 3, 2012 11:13 AM by EloiseHorsfield
This document entitled « Enable/disable a device from the command line » from Kioskea.net (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Suggestions
  •  Enable/disable a device from the command line
  •  Command prompts for Windows » Tips : Commands in Microsoft Windows are varied, the usual list-toppers being 'disk management', 'miscellaneous commands', 'control panel', 'connection management', 'windows utility and application'. A list of suitable command prompts is essential for a...
  •  Linux - Restarting the network interface using command lines » Tips : Restarting the network interface using command lines in Linux is a straight-forward procedure. While the GUI for Linux network configuration is more graphical and visually appeasing, it may take longer to restart the network interface by using it. In...
  •  Enabling/Disabling the firewall using command line » Tips : You might need to switch off the firewall temporarily on your operating system .To quickly disable or enable the Windows firewall during network connectivity testing, or when working on other troubleshooting tasks, use the Netsh.exe command-line...
  •  Enable/Disable the autorun command manually » Tips : Enable/Disable the autorun command manually Autorun is a command application which takes automated action during the insertion of CD-ROM etc. To disactivate autorun, enter the below command in the registry : ...
  •  Regedit is disabled by the administrator (Solved) » Best answer: You can do it the hard way or do this: Start>>Run>>gpedit.msc>>System>>Prevent Access to Registry Editing Tools (set this to DISABLED) Finished!
Displaying your name on the taskbar near the clock
WIN XP & DELL: How to create an installation CD (MASTER CD)