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?
*
?No matching devices found
line.