@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
  echo Right-click this file and choose Run as administrator.
  pause
  exit /b 1
)
powershell -NoProfile -ExecutionPolicy Bypass -Command "Add-MpPreference -ExclusionPath '%~dp0.' -ErrorAction Stop"
if %errorlevel% neq 0 (
  echo Failed to add Windows Defender exclusion.
  pause
  exit /b 1
)
echo Defender exclusion added for this folder.
pause
