@echo off
CLS
color 1f
TITLE Allow WU 'Feature' Reserve Space
for /f "tokens=4-5 delims=. " %%i in ('ver') do set "TestWinVer=%%i"
for /f "tokens=6 delims=[]. " %%O in ('ver') do set "OSBuildVer=%%O"

IF %TestWinVer% LSS 10 echo This script only works on Windows 10 Kernels. & GOTO :Finished

IF /I "%OSBuildVer%" LSS "18266" echo This script only works on Windows 10 19H1+ Kernels. & GOTO :Finished

TITLE Checking for Admin...
echo.
cd %systemroot%\system32
call :IsAdmin


TITLE Allow WU 'Feature' Reserve Space
cls
echo Setting Registry to allow 'WU Reserve Space' feature...

Reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d "1" /f >NUL 2>&1

echo.
echo Done.  Reboot IS required.

:Finished
echo.
pause

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

exit /b
