How to enable/disable windows 7 devices through a . bat or other file type?

Asked

Viewed 1,222 times

2

I need to enable and disable a specific device (device manager) frequently, and doing it manually is very annoying. I believe that with a . bat file it is possible to enable/disable each time I run. I saw that it is possible with Devcon, but it is a lot of effort for little. I appreciate if anyone knows any solution.

1 answer

2


You can disable and enable devices with Devmanview per command line.

To disable a device you can do with the following command:

devmanview.exe /disable "Nome do Dispositivo"

To enable:

devmanview.exe /enable "Nome do Dispositivo"

The device name must be the same as the one in the devices.

Save the files . bat in the directory that is the executable devmanview.exe, or copy this to System32.

Download Devmanview

  • I really liked this solution. But how would I make an IF to check whether the device is enabled or not? Have an example?

  • 1

    Devmanview does not offer this option, but you can check whether the device was disabled or batch-enabled earlier with an auxiliary file.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.