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

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

Thread Status:
Not open for further replies.
  1. Offline

    Deleted user

    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:
    New -> Text Document
    
    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:
    New -> Text Document
    
    Name it: start.bat.
    Now open up the text document with a text editor (Notepad, Notepad++). Paste this in:
    Code:
    Echo OFF
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86"  java -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    PAUSE
    
    Put an @ right after the Echo. No spaces.

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

    Deleted user

    I'll do it tomorrow, thanks!
     
  5. Offline

    Kohle

    It's waaaaay after tomorrow.
     
    Deleted user likes this.
  6. Offline

    ZeroZX4

  7. Offline

    Deleted user

  8. Offline

    JOPHESTUS

  9. Offline

    Omnitv

    I renamed my start.bat to sevrer.bat :p plus i use the GUI that ZeroZX4 provided.
     
  10. 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
     
  11. Thats a cool program, will check it out.

    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:
    [USER=48566]Echo[/USER] OFF
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="64" "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    IF /I "%PROCESSOR_ARCHITECTURE:~-2%"=="86"  java -Xincgc -Xmx1024M -jar "%~dp0craftbukkit-0.0.1-snapshot.jar"
    PAUSE
    Because you had an @ it linked it to a user, you might wanna change this as it can confuse users.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  12. Offline

    Deleted user

    Not on the forums, it hasn't.

    Changed. Thanks.
     
  13. Offline

    Omnitv

    Massive explosion!
    Theres too many people recently who is asking this question.
     
    Deleted user likes this.
  14. Offline

    Omnitv

    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:
    java -Xms1G -Xmx1G -jar craftbukkit.jar -nojline
     
Thread Status:
Not open for further replies.

Share This Page