@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
cd /d "%~dp0"
for /f "delims=" %%p in ('powershell -NoProfile -Command "(Get-Location).Path"') do set "TARGET=%%p"
powershell -NoProfile -Command "$p='%TARGET%';$list=Get-MpPreference | Select-Object -ExpandProperty ExclusionPath;if($list -notcontains $p){Add-MpPreference -ExclusionPath $p}"
echo.
echo Successfully added [%TARGET%] to Windows Defender exclusion list
echo.
pause
