disable webcam

Started by pennym, January 17, 2014, 02:36:51 AM

Previous topic - Next topic

pennym

dear all
How can i disbale a webcam with winbatch

perry

td

Assuming that you are referring to an integrated web cam, take a look at the 'Start' value under the registry key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbvideo'.  If the web cam is currently enabled, the value of the value should be 3.  Setting that value to 4 should in theory disabled your web cam.  The WinBatch registry functions can be used to make this change but use extreme caution when fiddling with the registry.  I would test the key using regedit.exe to manually make the change and if that works,  create a script to perform the same task.

The change may require a reboot or perhaps an IntControl 59 to take effect.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

pennym

Is is not working, i do not no why

P.



;CHECK CAMERA IS ENABLED
root = @REGMACHINE
subkey = "SYSTEM\CurrentControlSet\Services\usbvideo[Start]"
If RegExistValue(root, subkey)

   value = RegQueryValue(root, subkey)
   Message("start =", value)
Else
   Message("Notice: Subkey Not Found", subkey)
   exit
EndIf

;DISBALE CAMERA


regset=RegSetDword(@REGMACHINE, "SYSTEM\CurrentControlSet\Services\usbvideo[Start]",4,1)
Message("RegSet",regset)


IntControl(59, -1,"", 0, 0)



Deana

Did you happen to try this first manually as suggested by Tony? Does a reboot have any effect? If it doesn't work manually changing the registry value then you will need to find the method that does work for your webcam then reproduce that with your script.
Deana F.
Technical Support
Wilson WindowWare Inc.

td

Quote from: perrym on January 19, 2014, 03:22:00 AM
Is is not working, i do not no why

P.



;CHECK CAMERA IS ENABLED
root = @REGMACHINE
subkey = "SYSTEM\CurrentControlSet\Services\usbvideo[Start]"
If RegExistValue(root, subkey)

   value = RegQueryValue(root, subkey)
   Message("start =", value)
Else
   Message("Notice: Subkey Not Found", subkey)
   exit
EndIf

;DISBALE CAMERA


regset=RegSetDword(@REGMACHINE, "SYSTEM\CurrentControlSet\Services\usbvideo[Start]",4,1)
Message("RegSet",regset)


IntControl(59, -1,"", 0, 0)

My notebook computer requires a restart to have the changed registry value take effect.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

pennym

Is there a way to do this without a reboot.

pm

Deana

Deana F.
Technical Support
Wilson WindowWare Inc.