@echo off
TITLE Revert ReFS Registry switch.
COLOR 1F
echo.

cd %systemroot%\system32
call :IsAdmin
CLS
TITLE Revert ReFS Registry switch.
COLOR 1F

echo.
echo Simple script to revert ReFS switch used within MRP.
echo.

REM Done twice to make sure it is removed/reset to default OFF.

REG add "HKLM\SYSTEM\CurrentControlSet\Control\MiniNT" /v "AllowRefsFormatOverNonMirrorVolume" /t REG_DWORD /d "0" /f >nul 2>&1

REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\MiniNT" /v "AllowRefsFormatOverNonMirrorVolume" /f >nul 2>&1

echo.
echo Done. Reboot IS Required.

: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
)
