If you want an automated script to disable the webcam when Windows loads, this PowerShell command may work:
Powershell:
Get-PnpDevice -Class Camera | Disable-PnpDevice -Confirm:$false
You could schedule this script in Task Scheduler to run at Windows startup for automation.
This
MAY work. I have not tried any of the below as I have no use for this.
To DISABLE the cam when Windows loads:
1. Press `Win + R`, type “taskschd.msc” and hit Enter to open Task Scheduler.
2. Click **"Create Task"** (not Basic Task).
3. General Tab:
- Name: “Disable Webcam at Startup”
- Select “Run with highest privileges”
- Set “Configure for”* to **Windows 11**
4. Triggers Tab:
- Click "New", set it to “At startup” then click OK.
5. Actions Tab:
- Click “New” select Start a program”
- In **Program/script**, type:
powershell.exe -ExecutionPolicy Bypass -File "C:\Scripts\DisableWebcam.ps1"
- Click OK.
6. Conditions & Settings:
- Uncheck “Start only if on AC power” (if applicable).
- Click OK to save.
If you use that poweshell command to disable the cam, use the following to activate it again.
Powershell:
Get-PnpDevice -Class Camera | Enable-PnpDevice -Confirm:$false
I found one more option using a batch file to either 1 Enable 2 Disable prompted for a manual selection
Batch:
@echo off
echo Webcam Control Script
echo -----------------------
:: Close any software using the webcam
echo Closing apps that may be using the webcam...
taskkill /F /IM Skype.exe >nul 2>&1
taskkill /F /IM Zoom.exe >nul 2>&1
taskkill /F /IM Teams.exe >nul 2>&1
:: Check webcam status
echo Checking webcam status...
pnputil /enum-devices | findstr /i "Camera"
:: Ask user choice
echo.
echo 1. Disable Webcam
echo 2. Enable Webcam
echo 3. Exit
set /p choice="Enter choice (1-3): "
if "%choice%"=="1" (
echo Disabling webcam...
pnputil /disable-device "<Device ID>"
echo Webcam disabled!
)
if "%choice%"=="2" (
echo Enabling webcam...
pnputil /enable-device "<Device ID>"
echo Webcam enabled!
)
if "%choice%"=="3" (
echo Exiting...
exit
)
pause