@Echo off
title RW Windows Server Installer V1.0 - Updater
color 1b
echo ------------------------------------
echo -  RW Auto Server Installer v1.0   -
echo -           By Yahgiggle           -
echo -  Auto Update, Backup and reboot  -
echo ------------------------------------
setlocal enableDelayedExpansion
:timer
echo Auto update countdown started
timeout /t %Update% /NOBREAK 
goto updater
pause

:updater
echo Cheaking for updates
%Serverdrive%:\%ServerFolder%\steamcmd\steamcmd.exe +login anonymous +force_install_dir %Serverdrive%:\%ServerFolder%\Server +app_update 339010 validate +quit
FC %Serverdrive%:\%ServerFolder%\Server\version %Serverdrive%:\%ServerFolder%\Version\version>nul 
if errorlevel 1 goto rebooter
goto timer
pause

:rebooter
echo rebooting server for update
timeout /t 3 /NOBREAK
taskkill /pid rw_server.exe /t /F
echo updating then booting the server back up
%Serverdrive%:\%ServerFolder%\steamcmd\steamcmd.exe +login anonymous +force_install_dir %Serverdrive%:\%ServerFolder%\Server +app_update 339010 validate +quit
timeout /t 3 /NOBREAK
start cmd.exe /c Start %Serverdrive%:\%ServerFolder%\Server\Boot.bat
goto timer
pause
