topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 4:31 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA:Webcam/Mic on/off switch  (Read 3889 times)

spacedad

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 36
  • full of poison
    • View Profile
    • spaceraiders
    • Read more about this member.
    • Donate to Member
IDEA:Webcam/Mic on/off switch
« on: March 17, 2016, 11:50 AM »
a taskbar button to turn on and off your webcam and mic as most cheap ones don't have a real switch.
maybe it's more tricky than it sounds.
cheers,
sd.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: IDEA:Webcam/Mic on/off switch
« Reply #1 on: March 17, 2016, 01:23 PM »
Use devcon to disable/enable the device - you need the Device instance path from Device Properties.

eg.
Disable Microsoft Lifecam HD-3000:
Code: Text [Select]
  1. devcon disable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"

Enable Microsoft Lifecam HD-3000:
Code: Text [Select]
  1. devcon enable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"

Check status:
Code: Text [Select]
  1. devcon status "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"

Put it all together as a simple command file:
Code: Text [Select]
  1. @echo off
  2. devcon status "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002" | find /i "disabled" >NUL
  3. if errorlevel 1 goto running
  4. devcon enable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
  5. goto alldone
  6. :running
  7. devcon disable "@USB\VID_045E&PID_0779&MI_02\6&17F0D2C8&0&0002"
  8. :alldone
  9. 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.
« Last Edit: March 21, 2016, 07:26 PM by 4wd »