title: Bukkit server start batch file loop
body: <p>So basically what I want to do is start the Bukkit server with a modified ram usage, and have the batch script set up so that when the server stops, it restarts at the beginning of the batch file, but have a menu with a timed default option that automatically restarts the server. The second option will allow me to interrupt the batch file to keep the server from starting again once it has been stopped. </p>
  
  <p>What I want the script to start is this: <code>"C:\program files\Java\jre7\bin\java.exe" -Xincgc -Xmx4G -jar "craftbukkit.jar"</code></p>
  
  <p>So basically have a menu that is like this: 
  <code>press 1 to start bukkit, press 2 to exit the script.</code></p>
  
  <p>Option one will be timed to automatically start. </p>
  
  <p>I was able to get that far with having the menu, and it starting it automatically, but after I issue the stop command in Bukkit, it just exits and I can't figure out how to get it to restart at the beginning of the script. </p>
  
  <p>Here is the working menu, but not the starting back to the beginning once the program ends,</p>
  
  <pre><code>:start
  choice /c:CN /n /m "bukkit will start in 5 seconds. Press  to restart Now, or C to exit" /t:5 /d:N
  if errorlevel 2 ("C:\program files\Java\jre7\bin\java.exe" -Xincgc -Xmx4G -jar "craftbukkit.jar"  ) else goto start
  </code></pre>
  
  <p>But my original script is this, which pauses the window after the program exits:</p>
  
  <pre><code>"C:\program files\Java\jre7\bin\java.exe" -Xincgc -Xmx4G -jar "craftbukkit.jar"
  pause
  </code></pre>
  
  <p>I remember being able to do something like this back with the <code>autoexec.bat</code> with Windows XP, and it returning back to the menu after the menu option completed.</p>
  
  <p>Any help would be appreciated. </p>