@echo off
setlocal EnableExtensions DisableDelayedExpansion
title IP Info - Remove Chrome local IP allowance
set "IPINFO_POLICY_KEY=HKCU\Software\Policies\Google\Chrome\WebRtcLocalIpsAllowedUrls"
set "IPINFO_SITE=https://ipinfo.vutv.in"
echo Removing only %IPINFO_SITE% from the current user's Chrome local IP allowance.
echo Other policy entries are preserved.
echo.
for /f "tokens=1,2,*" %%A in ('reg query "%IPINFO_POLICY_KEY%" 2^>nul') do (
    if /I "%%B"=="REG_SZ" if /I "%%C"=="%IPINFO_SITE%" (
        reg delete "%IPINFO_POLICY_KEY%" /v "%%A" /f >nul
        if errorlevel 1 goto failed
    )
)
echo This site's user-level allowance has been removed.
echo Completely exit and reopen Chrome for the change to apply.
echo An organization policy may still allow this site; your administrator controls it.
pause
exit /b 0
:failed
echo The allowance could not be removed. Ask your Windows or Chrome administrator.
pause
exit /b 1
