title: Need auto-restart script in batch for minecraft server
body: <p>I am currently an administrator on a private Minecraft server, though in this case the technical question lies outside the scope of typical minecraft supoort.</p>
  
  <p>I wish to have the batch file that launches the server restart at 12 am and 12 pm, though I have little experience in batch and a cursory google search brings up nothing helpful.</p>
  
  <p>The issue I run into is both that I have no idea if batch CAN execute commands within a java server console, send the commands to save the server and then exit, and restart itself, due to only knowing basic batch functions.</p>
  
  <p>More specifically, I want the batch file itself to run a command in the server window after either 43200 seconds or on each of the 12s, then restart itself. I do not know how to get a batch file to run a command within the server command line, or if it's even possible.</p>
  
  <p>The current batch code is as follows:</p>
  
  <pre><code>@echo off
  :Minecraft
  echo (%time%) Minecraft started.
  java -Xms2048m -Xmx2048m -XX:PermSize=128m -jar FTBServer-1.6.4-965.jar nogui
  pause
  echo (%time%) WARNING: Minecraft closed or crashed, restarting.
  ping 1.1.1.1 -n 1 -w 3000 &gt;nul
  goto Minecraft
  </code></pre>
  
  <p>Any help would be aprreciated. Thanks.</p>