I have a USB barcode scanner connected to a windows 10 tablet. I need to switch this barcode scanner on/off from a powershell script running on windows).
Reading the microsoft doc online, would seem tat devcon.exe is the way to go.
I installed the appropriate (x64) windows kits package and i'm able to use devcon.exe to find devices, remove devices, add devices, get their status etc..
When it comes to run a "devcon disable" on my particular device, devcon says the device does not exist.
Inspecting the device from Windows i was able to read the vendor id (0x065A)
(I tried the following commands in an administrator powershell window)
PS C:\Users\Hs> & "C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon.exe" status USB\VID_065A*
USB\VID_065A&PID_A001\6&7998A49&0&3
Name: USB Input Device
Driver is running.
1 matching device(s) found.
All good
PS C:\Users\Hs> & "C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon.exe" enable USB\VID_065A*
USB\VID_065A&PID_A001\6&7998A49&0&3 : Enabled
1 device(s) are enabled.
Not very useful since the device was already working but at leas it confirms that devcon can see my device
now for the problematic part
PS C:\Users\Hs> & "C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon.exe" disable USB\VID_065A*
USB\VID_065A&PID_A001\6&7998A49&0&3 : Disable failed
No matching devices found.
Any idea about what i'm doing wrong?