Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # SCRIPT TO DISABLE THE WINDOWS 11 COPILOT HARDWARE KEY
- # This change applies only to the current user.
- $RegistryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
- $ValueName = "SetCopilotHardwareKey"
- $ValueData = 0
- $ValueType = "DWord"
- try {
- # Check if the registry path exists. If not, create it.
- if (-not (Test-Path $RegistryPath)) {
- New-Item -Path $RegistryPath -Force | Out-Null
- Write-Host "Created registry path: $RegistryPath" -ForegroundColor Green
- }
- # Set the registry value. This creates it if it doesn't exist or overwrites it if it does.
- Set-ItemProperty -Path $RegistryPath -Name $ValueName -Value $ValueData -Type $ValueType -Force
- Write-Host "Successfully set '$ValueName' to 0." -ForegroundColor Green
- Write-Host "The Copilot key has been disabled for the current user: $([System.Security.Principal.WindowsIdentity]::GetCurrent().Name)"
- Write-Host "---------------------------------------------------------"
- Write-Host "IMPORTANT: You must restart your computer for this change to take effect." -ForegroundColor Yellow
- }
- catch {
- Write-Host "An error occurred:" -ForegroundColor Red
- Write-Host $_.Exception.Message -ForegroundColor Red
- }
Advertisement
Add Comment
Please, Sign In to add comment