Use PowerShell Script to Enable or Disable Webcam

Cette page contient des modifications qui ne sont pas marquées pour la traduction.

Auteur avatarTechbuddy | Dernière modification 11/07/2024 par Techbuddy

We will learn here to create PowerShell scripts to toggle web camera status quickly on alaptop with Windows 10.

Introduction

Required Skills

  • Familiar with coding/software development/programming languages
  • Familiar using laptop

Matériaux

Laptop

Outils

Programming Language

Étape 1 - Run the Windows Powershell command-line tool as admin

Étape 2 - Use Disable-PnpDevice cmdlet to disable the built-in webcam by instance Id

Étape 3 - To make the webcam work again, use Enable-PnpDevice cmdlet

Étape 4 - Save the commands to disable.ps1 and enable.ps1 files

Étape 5 - Create desktop shortcuts to run script directly

Notes et références

Reference - https://www.dynamsoft.com/codepool/powershell-disable-enable-webcam-windows.html

Commentaires

Published