Windows 7 – Enable/Disable Device via Command Line

command linedriverswindows 7

I have a device that I often enable and disable using the Device Manager. I'd like to write a script to do this programmatically (that is, using the command line). I saw a program called devcon that works for Windows 2000, Windows XP and Windows Server 2003, but I need one that works for Windows 7. Is there one freely available?

Best Answer

  1. Download the WDK Windows Driver Kit 7.1.0 from Microsoft.
  2. Use the Universal Extractor to extract the contents of the ISO to a temporary location... or use whatever method you like to mount and get inside the ISO.
  3. You can use the same tool to extract the install file "WDK\setuptools_x64fre.msi" to a temporary directory.
  4. In that temporary directory you will find "WinDDK\7600.16385.win7_wdk.100208-1538\tools\devcon\amd64\devcon.exe". It has been tested to work with Win7x64, and it is part of the most recent Windows Driver development kit.

So, there is Devcon.exe for Windows 7 for you. It works with Windows 7, and it is free.

Instructions taken from the Microsoft Answers forum.

Related Question