Windows Launch Shortcut 2020-02-13

Windows shortcut to launch the spigot.jar, complete with a cool window title and icon

  1. ForbiddenSoul
    This is simply a way to set up Windows to launch the spigot.jar using only a simple shortcut complete with a custom title and icon.

    Here are the step by step instructions to creating the shortcut.
    1. Right click in a folder or the desktop and select "new" > "Shortcut".
    2. In the input box type: "cmd /C start /HIGH /WAIT /B java -jar spigot-1.15.2.jar nogui" (no quotes) and click next.
    3. For the input box of the name type "Spigot" and click finish.
    4. Right click the newly created spigot shortcut and select properties.
    Now we will edit some settings depending on your preferences and setup.

    "Target:" contains what you typed in for step 2.
    It was originally "cmd /C start /HIGH /WAIT /B java -jar spigot-1.15.2.jar nogui".
    Let us break down what all this means:
    First we all telling Windows to run a program called "cmd" (command prompt).
    Then we pass "cmd" the "/C" parameter which tells "cmd" to Close after it has finished running it's command(s) (server shuts down or restarts). You may change this to /K if you would like to leave the window open after Spigot has shut down.
    Now "cmd" starts up and we instruct "cmd" to run a program called "start".
    We now pass three parameters to "start"
    "/HIGH" instructs the priority class the process should be run in.
    "/WAIT" instructs "start" to wait for the application it started to terminate.
    "/B" instructs "start" to use the same command line window that is already open, instead of create a new one.
    Now "start" starts up and well instruct "start" to run a program called "java".
    "-jar" instructs "java" that we would like to run a .jar file.
    "spigot-1.15.2.jar" is the name of the .jar file we would like to run.
    This should be the name of the file you wish to run (the version number might be different), and you should change this to match your .jar filename. Do not worry about the path to the file, just the name.
    "java" now runs a program called "spigot-1.15.2.jar" and we pass the "nogui" parameter. This will hide the vanilla Mine Craft server GUI from appearing keeping everything in one simple console window for us.
    You can remove this if you wish to show the GUI along side the console.

    Next we need to specify the folder where we can find the spigot.jar file.
    This is entered in the "Start in:" input box. This might be something like "C:\Spigot". Alternatively, if the shortcut is in the same folder as your spigot.jar, you may enter "%~dp0" as the path (use same directory as the shortcut).

    Now we might as well dress it up a little and give it an official icon. You can get an official spigot icon file from [​IMG] (right click and save as).
    Now click "Change Icon..." -> "Browse..." and navigate to the .ico file you just saved. You are welcome to use any other icon you want as well, totally up to you.
    Now we should have something that looks like this:
    Click "OK", double click your new shortcut and you will have something that looks like this:

    The window title will be what ever you have named your shortcut.

    This last step is optional if you would like your server "restart" command to work correctly.
    In your spigot.yml we will change the value of "restart-script:" to the location of your shortcut. Shortcuts have the file extension of .L-N-K, .lnk.
    If the shortcut is in the same folder as spigot, you can simply use "restart-script: Spigot.lnk" where "Spigot" is the name of your shortcut, but you may need to provide a full path for example "C:\SomeFolder\Spigot.lnk".

    That's it. Now we have a fully functional shortcut with a custom window title and icon.