@echo off

set SCRIPT_SETTINGS=settings.cmd
set CUSTOM_SETTINGS=..\custom\settings.cmd

rem default: disabled
set windows_targetrelease=0

echo ####### %0 #######

echo.
echo searching for SCRIPT settings ...
if NOT EXIST %SCRIPT_SETTINGS% (
  echo INFO: config file %SCRIPT_SETTINGS% NOT FOUND
) else (
  echo OK. Loading SCRIPT settings ...
  call %SCRIPT_SETTINGS%
)

echo.
echo searching for CUSTOM settings ...
if NOT EXIST %CUSTOM_SETTINGS% (
  echo INFO: config file %CUSTOM_SETTINGS% NOT FOUND
) else (
  echo OK. Loading CUSTOM settings ...
  call %CUSTOM_SETTINGS%
)

echo ++++++++++++++++++++++++++++++++++
echo windows_targetrelease=%windows_targetrelease%
echo ++++++++++++++++++++++++++++++++++
echo.

if %windows_targetrelease% == 0 (
  echo WARNING: windows target release NOT set!
) else (

  echo setting windows update target release ...
  reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" ^
    /v TargetReleaseVersion /t REG_DWORD /d 1 /f
  reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" ^
    /v TargetReleaseVersionInfo /t REG_SZ /d %windows_targetrelease% /f

)

echo ####### %0 #######

