Project Zomboid

Project Zomboid

Not enough ratings
Auto server restart script for Dedicated Server Tools at Windows Server
By Colorful and 1 collaborators
A bat script made by Miku39.
It is used to automatically quit and update the server through steamcmd. Then It starts the server tools again to update the workshop mods.
   
Award
Favorite
Favorited
Unfavorite
Script
@echo off & setlocal enabledelayedexpansion color 3F title Project Zomboid dedicated server auto restart script chcp 65001 & cls & echo= set nTime=86400 ::*****This is the time(seconds) you want the server to restart every time****** set /a strTime_d=!nTime! / 86400 set /a strTime_h=!nTime! %% 86400 / 3600 set /a strTime_m=!nTime! %% 86400 %% 3600 / 60 set /a strTime_s=!nTime! %% 60 :restart echo Quitting server... taskkill /f /im java.exe taskkill /f /im javaw.exe taskkill /f /im ProjectZomboid64.exe echo Updating server tools... cd "C:\steamcmd\steamcmd.exe" ::*****This is your steamcmd file path **** steamcmd +login anonymous +app_update 380870 +quit echo Starting server.. cd "C:\steamcmd\steamapps\common\Project Zomboid Dedicated Server" ::*****This is your dedicated server tool path***** start StartServer64.bat echo Server started, and will restart in !strTime_d! day(s) !strTime_h! hour(s) !strTime_m! minute(s) !strTime_s! second(s)! timeout !nTime! echo Server restarting goto restart

  • Creat a txt file
  • Copy and paste the code to it.
  • Replace 86400 with X for every X seconds you want the server to restart.
    set nTime=86400
  • Replace "C:\steamcmd\steamcmd.exe" with your steamcmd file path
  • Replace "C:\steamcmd\steamapps\common\Project Zomboid Dedicated Server" with your project zomboid dedicated server tools path
  • Save and rename it to "projectZomboidAutoServerRestartScript.bat"
  • Run the script.
If you are running in Linux, try this guide.
2 Comments
Colorful  [author] Oct 27, 2022 @ 10:41pm 
I think native bat script can't do this. Maybe you could write a python program to send command to the server.
tCrowD Oct 21, 2022 @ 7:17am 
Is it possible for script to message players about restart? like "server restarts in 5 min" and etc