2

My pc has the set of the fn keys to perfome actions like lower/raise the volume, active/deactive the mousepad, mic and webcam, etc. I formatted my pc yesterday (windows 10 if it matters) and all of them work except F8 (the webcam one). I can't really activate the webcam any other way that I know of. I've looked it up and found this question about activating the numlock key via powershell and tried with f8, but didn't work..

So I was wondering if there is any other way to activate the F8 key by cmd/powershell or to activate the webcam any other way?

oilijk
  • 21

2 Answers2

3

Sure there is a way to take actions of any key(s) on the keyboard, using many scripting languages. You've been able to do this for decades using VBScript. So, this is not a PowerShell thing.

Resources:

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.sendkeys?view=netframework-4.8

https://www.jesusninoc.com/11/05/simulate-key-press-by-user-with-sendkeys-and-powershell

So, stuff like this... two ways to use this, the PowerShell way...

[System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms") | Out-Null
[System.Windows.Forms.SendKeys]::SendWait("{F8}")

The VBScript way, that you can also use exactly the same way.

$wshell = New-Object -ComObject wscript.shell
$wshell.SendKeys("{F8}")
postanote
  • 5,136
0

It may be a driver issue, since you formatted recently. Try going to Device Manager by pressing Windows+X, and then scanning the camera device for new drivers.

Good Luck and welcome to SuperUser!

Coder14
  • 14