Skip to main content

PowerShell script for disabling the Edge Desktop Search Bar (Shift+Alt+F).

# Disable the Edge Desktop Search Bar (Shift+Alt+F)
# Run PowerShell as Administrator before executing this script

Write-Host "Disabling Edge Desktop Search Bar..." -ForegroundColor Cyan

# Registry path for Edge policies
$regPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge"

# Ensure the Edge policy key exists
if (-not (Test-Path $regPath)) {
    Write-Host "Creating registry path: $regPath"
    New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft" -Name "Edge" -Force | Out-Null
}

# Set WebWidgetAllowed to 0 (disabled)
Write-Host "Setting WebWidgetAllowed to 0..."
New-ItemProperty -Path $regPath -Name "WebWidgetAllowed" -Value 0 -PropertyType DWord -Force | Out-Null

# Confirm the change
$val = Get-ItemPropertyValue -Path $regPath -Name "WebWidgetAllowed"
Write-Host "WebWidgetAllowed is now set to: $val" -ForegroundColor Green

# Optional: Disable via Group Policy registry equivalent
# This ensures consistency even if Group Policy is applied later
$gpPath = "HKLM:\SOFTWARE\Policies\Microsoft\Edge"
New-ItemProperty -Path $gpPath -Name "WebWidgetAllowed" -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Edge Desktop Search Bar disabled successfully. Please restart your PC." -ForegroundColor Yellow