title: How do i make this batch file start and after 2 hours it will shutdown and start the same program?
body: <p>Okay, so I made a Rust server. I'm starting the program with a <code>.bat</code> file. The <code>.bat</code> file contains:</p>
  
  <pre><code>rust_server.exe -batchmode -hostname "XtraRust" -cfg "cfg/server.cfg" -maxplayers 25 -port 28015 -datadir "serverdata/" -map "rust_island_2013"
  </code></pre>
  
  <p>How do I make a batch file to start this and shutdown after 2 hours and then start the program again with everything automated?</p>
  
  <p>I tried using:</p>
  
  <pre><code>@echo off
  :loop
  start rust_server.exe
  timeout /t 1200 &gt;null
  taskkill /f /im rust_server.exe &gt;nul
  goto loop
  </code></pre>
  
  <p>But it starts opening the file every 0.25 sec, which will lead to a computer crash.</p>