Webcam disconnect connect


Ducarme

New member
Local time
10:58 AM
Posts
1
OS
macMonterey
Hello,

I'm using a Logitech C270 webcam with Windows 11 24H2.
I'd like to disable the camera and microphone when the PC shuts down
and then turn it back on when requested.

I remembered to disconnect and reconnect the USB cable.
Perhaps it's better to use a batch file or not, without going through:
Start > Settings > Privacy & Security > Camera

Thank you for your answers.
 

My Computer

System One

  • OS
    macMonterey
Hi, welcome.

Why is it you think that the webcam operates when your PC is inactive or shut down? It’s not a wireless cam, nor is it a powered cam and relies on your PC being active to operate.

Are you asking it to be inactive on Windows loading? I’m not sure which.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 Build 22631.5039
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (4th Gen?)
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / MX Air Cordless
    Internet Speed
    1000/400Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    I’m on a horse.
  • Operating System
    Windows 11 Pro 23H2 Build: 22631.4249
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
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
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 Build 22631.5039
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (4th Gen?)
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard
    Monitor(s) Displays
    5 x LG 25MS500-B - 1 x 24MK430H-B - 1 x Wacom Pro 22" Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech: G402 / G502 / Mx Masters / MX Air Cordless
    Internet Speed
    1000/400Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    I’m on a horse.
  • Operating System
    Windows 11 Pro 23H2 Build: 22631.4249
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.

Latest Support Threads

Back
Top Bottom