How To Make A "start.bat" or "server.bat"

Discussion in 'Bukkit Help' started by ShootToMaim, Feb 13, 2012.

  1. Does it ever bother you when there are tutorials that tell you to start your server using something called a "start.bat" and they don't even tell you what it is? Well it does for me.
    Start.bat is a file that allows you to start your server, and allows you to use commands from it (Example: Kick, Ban, etc.).
    Most tutorials on the Bukkit Wiki tell you to start your server by double clicking the Craftbukkit Snapshot, but to stop your server, you have to go into Windows Task Manager and stop the process. This way sucks. It's time-consuming, and it's a waste of time.
    "STFU and tell us how to make a "start.bat" already!" you're screaming. Alright, alright, i'll start.
    Now go to the folder with all your server files "plugins folder, whitelist.txt, etc.". Right-click, and select:
    Code (Text):
    1.  
    2. New -> Text Document
    3.  
    Name it: start.bat.
    Now open up the text document with a text editor (Notepad, Notepad++). Paste this in:
    Does it ever bother you when there are tutorials that tell you to start your server using something called a "start.bat" and they don't even tell you what it is? Well it does for me.
    Start.bat is a file that allows you to start your server, and allows you to use commands from it (Example: Kick, Ban, etc.).
    Most tutorials on the Bukkit Wiki tell you to start your server by double clicking the Craftbukkit Snapshot, but to stop your server, you have to go into Windows Task Manager and stop the process. This way sucks. It's time-consuming, and it's a waste of time.
    "STFU and tell us how to make a "start.bat" already!" you're screaming. Alright, alright, i'll start.
    Now go to the folder with all your server files "plugins folder, whitelist.txt, etc.". Right-click, and select:
    Code (Text):
    1.  
    2. New -> Text Document
    3.  
    Name it: start.bat.
    Now open up the text document with a text editor (Notepad, Notepad++). Paste this in:
    Code (Text):
    1.  
    2. Echo OFF
    3. IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    4. IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86"  java -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    5. PAUSE
    6.  
    Put an @ right after the Echo. No spaces.

    Let's break this down now.
    Code (Text):
    1.  
    2. "%~dp0craftbukkit-0.0.1-snapshot.jar"
    3.  
    There are 2 lines of this in the code. What this means is that your Craftbukkit.jar should be named
    Code (Text):
    1.  
    2. craftbukkit-0.0.1-snapshot.jar.
    3.  
    If you want to rename your Craftbukkit.jar, just change the:
    Code (Text):
    1.  
    2. craftbukkit-0.0.1-snapshot.jar
    3.  
    to:
    Code (Text):
    1.  
    2. <Insert name here>
    3.  
    Pretty simple eh?

    So that's all for this tutorial! If you need help with making your start.bat, just post down below!
    If you need any more tutorials, just PM me!

    Let's break this down now.
    Code (Text):
    1.  
    2. "%~dp0craftbukkit-0.0.1-snapshot.jar"
    3.  
    There are 2 lines of this in the code. What this means is that your Craftbukkit.jar should be named
    Code (Text):
    1.  
    2. craftbukkit-0.0.1-snapshot.jar.
    3.  
    If you want to rename your Craftbukkit.jar, just change the:
    Code (Text):
    1.  
    2. craftbukkit-0.0.1-snapshot.jar
    3.  
    to:
    Code (Text):
    1.  
    2. <Insert name here>
    3.  
    If you have Java 7 instead of Java 6, change:
    Code (Text):
    1.  
    2. ProgramFiles(x86)%\Java\jre6\bin\java.exe
    to:
    Code (Text):
    1.  
    2. ProgramFiles(x86)%\Java\jre7\bin\java.exe
    Pretty simple eh?

    So that's all for this tutorial! If you need help with making your start.bat, just post down below!
    If you need any more tutorials, just PM me!
     
    iKeirNez likes this.
  2. Offline

    flamedaces

    please note:

    you did not include what the processor settings did
    some users have java 7, or a different file path
    you never explained how to change the RAM settings
     
    marti.2001 likes this.
  3. Offline

    Stone_Tigris

    Hasn't this already been done in more detail on the wiki?
     
  4. I'll do it tomorrow, thanks!
     
  5. Offline

    Kohle

    It's waaaaay after tomorrow.
     
    ShootToMaim likes this.
  6. Offline

    ZeroZX4

  7. I renamed my start.bat to sevrer.bat :p plus i use the GUI that ZeroZX4 provided.
     
  8. Offline

    ZeroZX4

    its Bertware who provide us all with GUI i just pasting link to it


    and for ppl who need to stick to bats i found this

    http://www.teamcti.com/trayit/trayit.htm

    this program allow you to minimize any window to tray with removing it from task bar and leaving only in tray

    or removing it from both task bar and tray

    just right click on window minimize button

    [​IMG]

    edit
    ---------------

    with pail
    http://dev.bukkit.org/server-mods/pail/

    http://dev.bukkit.org/server-mods/pailplus/

    so we r not forced to choice between console and gui we can choose between exe and plugin gui
     
  9. Thats a cool program, will check it out.
     
  10. Good tutorial, now I can link my friends here who are trying to start a server, also I don't know if you noticed this in your post

    Code (Text):
    1. [USER=48566]Echo[/USER] OFF
    2. IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    3. IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86"  java -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    4. PAUSE
    Because you had an @ it linked it to a user, you might wanna change this as it can confuse users.
     
  11. Not on the forums, it hasn't.

    Changed. Thanks.
     
  12. Massive explosion!
    Theres too many people recently who is asking this question.
     
    ShootToMaim likes this.
  13. Disco!
    Also Maim can you please add the nojline option aswell coz people who dont like C++ redis... dont waht it they can use this as an alternative.
    -nojline to the end of your start line, which turns off jline and will allow you to avoid that error.
    Ex:
    Code:
    PHP:
    1. java -Xms1G -Xmx1G -jar craftbukkit.jar -nojline
     

Share This Page