title: Enabling/disabling a device in Windows 10 from command line
body: <p>I have a specific piece of hardware which I'd like to disable and re-enable each time my Windows restarts. I created a batch script which is supposed to do that, along with running my program afterwards:</p>
  
  <pre><code>cd %~dp0
  devcon.exe disable "PCI\VEN_1002&amp;DEV_687F"
  timeout /t 3
  devcon.exe enable "PCI\VEN_1002&amp;DEV_687F"
  
  runMyWindows.exe --totally-not-virus
  </code></pre>
  
  <p>I am not sure if <code>devcon.exe</code> is a proper application for this in the first place because I have no experience with writing Windows scripts at all.</p>
  
  <p>However, I have noticed that those commands don't quite do the job because my <code>runMyWindows.exe</code> program doesn't work as it should until I go to Windows Device Manager and manually disable and re-enable this device.</p>
  
  <p>I have only 1 user on this machine which is in "Administrator" group and I am not running this script in any special way except double-clicking the <code>.bat</code> file, or in case of the restart, it is run from the startup folder (<code>C:\Users\oxxo\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup</code>).</p>
  
  <p>Is there a way to do this properly within my batch script which should be run automatically on Windows startup?</p>