Use
devcon to disable/enable the device - you need the
Device instance path from Device Properties.
eg.
Disable Microsoft Lifecam HD-3000:
devcon disable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
Enable Microsoft Lifecam HD-3000:
devcon enable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
Check status:
devcon status "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
Put it all together as a simple command file:
@echo off
devcon status "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002" | find /i "disabled" >NUL
if errorlevel 1 goto running
devcon enable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
goto alldone
:running
devcon disable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
:alldone
devcon status "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
Now any time you run the command file the status of the webcam will toggle between enabled and disabled.
DevCon is attached here for ease of download, normally you'd need to download and install a MS development kit but it is available elsewhere on the net.
NOTE: You may need to Run as Admin if you have UAC enabled.