Shazzer Posted July 28, 2022 Share Posted July 28, 2022 (edited) I just want to share a bat file I wrote to update DCS Server when a change is detected on the https://updates.digitalcombatsimulator.com/ site I am using a program called "Website-Watcher" to monitor for any changes to the specific text. Once a change is detected, it launches my bat file that shuts down any running servers, updates DCS, restores the missionscripting.lua file then restarts the servers. This script has worked wonderfully for the last three updates. I am using "Website-Watcher" to monitor https://updates.digitalcombatsimulator.com/ but any website scrapper that can launch a bat file will work. null echo Starting Update Tasks timeout /t 3 /nobreak :CheckDCS echo "Checking if DCS Servers are running" :: Update the Server names (Instance) taskkill /F /FI "WINDOWTITLE eq Dedicated-001" 2>NUL | find /I /N "Dedicated-001">NUL taskkill /F /FI "WINDOWTITLE eq Dedicated-002" 2>NUL | find /I /N "Dedicated-002">NUL taskkill /F /FI "WINDOWTITLE eq Dedicated-003" 2>NUL | find /I /N "Dedicated-003">NUL IF NOT %ERRORLEVEL%==0 GOTO RunDCSUpdater echo "DCS is still running. Checking again in 30 seconds." timeout /t 30 /nobreak GOTO CheckDCS :RunDCSUpdater START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS_updater.exe" --quiet update" timeout /t 30 /nobreak GOTO CheckDCSUpdater :CheckDCSUpdater echo "Checking if DCS Updater has completed updating" TASKLIST /FI "IMAGENAME eq DCS_updater.exe" 2>NUL | find /I /N "DCS_updater.exe">NUL IF NOT %ERRORLEVEL%==0 GOTO RestoreUnsanitizedMissionScripting echo "DCS is updating. Checking again in 30 seconds." timeout /t 30 /nobreak GOTO CheckDCSUpdater :RestoreUnsanitizedMissionScripting echo "Restoring unsanitized MissionScripting.lua File" START "" "C:\Windows\SysWOW64\xcopy.exe" /Y "C:\Users\Administrator\Saved Games\Mission Scripting Backup\MissionScripting.lua" "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\Scripts" timeout /t 3 /nobreak GOTO StartDedicatedServers :StartDedicatedServers echo "Starting DCS Servers" timeout /t 3 /nobreak START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS.exe" --server --norender --webgui -w Dedicated-001" timeout /t 30 /nobreak START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS.exe" --server --norender --webgui -w Dedicated-002" timeout /t 30 /nobreak START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS.exe" --server --norender --webgui -w Dedicated-003" timeout /t 30 /nobreak START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS.exe" --server --norender --webgui -w Dedicated-004" timeout /t 30 /nobreak :: START "" /high "C:\Program Files\Eagle Dynamics\DCS World OpenBeta Server\bin\DCS.exe" --server --norender --webgui -w Dedicated-005" :: timeout /t 30 /nobreak echo "Update and restart of the dedicated servers has been completed" I hope this helps and pls share any other ideas, tweaks or other methods Shazzer DCS_Auto_Update.bat Edited August 26, 2022 by Shazzer spelling / cleaned up the bat file and add comments 1 Link to comment Share on other sites More sharing options...
Shazzer Posted August 26, 2022 Author Share Posted August 26, 2022 Bump Link to comment Share on other sites More sharing options...
santa8086 Posted September 14, 2022 Share Posted September 14, 2022 Thank you for sharing this! Link to comment Share on other sites More sharing options...
MarkP Posted April 22, 2023 Share Posted April 22, 2023 (edited) Im trying this for the next update. Hands down this is soo appriciated. (Hopefully) gone are the days of shoulting squad memebers who cant fly on the server since i didint updated the server yet Thanks for sharing!! Edited April 22, 2023 by MarkP Main-Module: F-16C, AH-64D Maps: Syria, Persian Gulf, South Atlantic, Caucasus, 1944 Normandy, NTTR Hardware: VKB Gunfighter mk.2 Pro, WinWing Orion F16, VKB T-Rudder, HP Reverb G2 PC Specs: Intel 13900K, ASUS ROG STRIX Z790-E, 64GB DDR5-5800 RAM, GeForce RTX 4090, Win 11x64 Link to comment Share on other sites More sharing options...
Recommended Posts