Running the devcon.exe properly (enabling/disabling the device from command line in Windows 10)

2

1

I have a device in my PC which runs on Windows 10, Enterprise version:

I would like to disable and re-enable this particular device (and possible all others of the same prefix) every time Windows restart, preferably completely without my (or anyone else's) interaction.

In order to achieve this, I am trying to write a simple batch script of 2 lines and putting script's shortcut to folder opened with pressing WIN+R and typing shell:startup. The content of the script is:

devcon.exe disable "PCI\VEN_1002&DEV_687F*"
devcon.exe enable "PCI\VEN_1002&DEV_687F*"

However, running this (from command line, in folder where devcon.exe is located) as a regular user which is actually "an Administrator" doesn't produce any errors in the command prompt, but it also doesn't disable the card - it doesn't look like disabled in Device Manager and the card is still visible and usable in some other programs/tools.
After "re-enabling" (which obviously re-enables nothing) the card simply doesn't show the same performance like it does when I do all this manually, by mouse-clicking in Device Manager.

I tried various combinations of running this as "an Administrator" because by many other suggestions I am suppose to run "it" like this (just to mention that I am very new in the Windows environment). I tried to run cmd as an admin, devcon as an admin, run both things in the same time as an admin, tried to run my script as a task in Task Scheduler with "Run with highest privileges" checked, using runas and finally, enabling the built-in Administrator account, rebooting the machine, logging in as an Administrator user and trying to run both commands individually, each time welcomed by the following error:

C:\Users\mm\Downloads>devcon.exe disable "PCI\VEN_1002&DEV_687F*"
PCI\VEN_1002&DEV_687F&SUBSYS_0B361002&REV_C3\6&3B544653&0&00000008: Disable failed
No matching devices found.

The screenshot provided should prove that device is there and that path which I'm trying to use in devcon.exe is correct.

Am I using devcon.exe incorrectly? If not, can someone explain me what could be the reason of my error and how to possibly get rid of it?

errata

Posted 2017-11-30T00:41:47.737

Reputation: 133

Have you tried to copy and paste the entire instance ID instead of using a *? – Appleoddity – 2017-11-30T00:56:50.967

Possible duplicate of https://superuser.com/questions/616111/how-to-restart-a-video-card-driver-in-windows-7

– Appleoddity – 2017-11-30T00:58:40.153

I did, yes, and then instead of full device path in my error, I get only No matching devices found line. – errata – 2017-11-30T00:59:41.667

Answers

2

I thought your issue could be related to an incompatibility with Windows 10 Enterprise, as I've had some issues at work with it. However, it's most likely due to using the wrong version of devcon.exe I would confirm you're using devcon.exe from the x64 folder.

Nic Ballarini

Posted 2017-11-30T00:41:47.737

Reputation: 36

Wow! Just wow! :) Thanks a lot for this suggestion, it seems that that was the actual problem - wrong devcon.exe version :/ (Note to self - next time you work after midnight, just stop and go to sleep) – errata – 2017-12-07T09:52:42.900