@echo off
setlocal
net session >nul 2>&1
if %errorlevel% neq 0 (
  powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)

powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $id='mmlaolebmjngecbmgifnlbejcppnjade'; $path='HKLM:\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist'; if(Test-Path $path){ $props=Get-ItemProperty -Path $path; foreach($p in $props.PSObject.Properties){ if($p.Name -match '^\d+$' -and [string]$p.Value -like ($id+';*')){ Remove-ItemProperty -Path $path -Name $p.Name -Force; Write-Host ('Removed policy value: ' + $p.Name) } } }; Write-Host 'Close all Chrome windows and open Chrome again.'"

echo.
echo Done. Close all Chrome windows and open Chrome again.
pause
