Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: ====================================
- :: FILE NAME: valheimmonitor.bat
- :: AUTHOR: MokeyII
- :: Editor: Sevaver
- :: Directions: Place "valheimmonitor.bat" in your valheim WIN64 Directory
- :: Set your path below
- :: Example: (SET valheimPath=YOUR PATH HERE)
- :: ====================================
- ::
- :: _____Set your valheim Path Here_____
- ::
- SET valheimPath=C:\Steam\valheim
- ::
- :: Be Sure to Convert to an EXE after defining path.
- ::========================
- :: DO NOT EDIT BELOW HERE
- ::========================
- COLOR 30
- :valheimmonitor
- SET img=valheim_server.exe
- tasklist /fi "imagename eq %img%" /fi "status eq running" |find /i "%img%" >nul && (
- echo =======================================================
- echo Valheim Server is running, continuing to monitor.
- echo =======================================================
- PING 1.1.1.1 -n 1 -w 2500>nul
- goto valheimmonitor
- ) || (
- COLOR 4F
- PING 1.1.1.1 -n 1 -w 500>nul
- echo =======================================================
- echo %date% %TIME% SERVER IS NOT RUNNING, RESTARTING SERVER NOW!!
- echo =======================================================
- >>crashreport.txt (
- echo %date% %TIME% SERVER IS NOT RUNNING RESTART.BAT INITIATED!
- )
- PING 1.1.1.1 -n 1 -w 2000>nul
- COLOR 4F
- start "valheimServer" "%valheimPath%\valheimReboot.bat"
- echo Server startup initiated!
- exit
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement