@echo off
TITLE Revert Hide Windows Defender From Settings App Registry switch.
COLOR 1F
mode con cols=95 lines=10
echo.

cd %systemroot%\system32
call :IsAdmin
CLS
TITLE Windows 10 Revert Hide Windows Defender From Settings App Registry switch.
cls
color 1f
echo.
ver | findstr /i " 10\.0\." > nul
IF "%ERRORLEVEL%" EQU "0" goto :Win10
echo This script only works on Windows 10 Kernels.
echo.
pause
exit

:Win10
echo.
echo Simple script to revert 'Hide Windows Defender' from Settings App switch used within MRP.
echo.

REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "SettingsPageVisibility" /f >nul 2>&1

echo.
echo Done. Note: Sign/Log out is required to reset this setting.

:Finished
TIMEOUT /T 5 >NUL 2>&1
exit

:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls
 echo.
 Echo You must have administrator rights to continue...
 echo.
 Pause
 Exit
)
