restart-script-location (will this work with .bat files)?

Discussion in 'Spigot Discussion' started by JoeGray100, Jul 10, 2013.

  1. JoeGray100

    Supporter

    Would like to know if one can specific a path such as c:\startup.bat or if this will only work for .sh under Linux.

    Best,
    JAG100
     
  2. Yes.
    If you put the correct name and extension it will
     
  3. JoeGray100

    Supporter

    What's the best way to test it? I used this format: "c:\myncraft\start.bat"
     
  4. If its a .bat i'm assuming that you use windows and that is your path to your start.bat
    Now just go to the console or in-game and do the command /restart
    Then the server will restart.
    PS: I recomend that in the script you use EXIT instead of PAUSE because if you use PAUSE when you do /restart
    the old window will still be there and won't close until you press a key.
    But when you put EXIT it will close automatically
     
  5. JoeGray100

    Supporter

    Great tip!!! Working great. Thank you very much.
     
  6. JoeGray100

    Supporter

    Whoops, one little problem. In Windows I have spaces in some of my directory names such as:

    restart-script: C:\"Assassination (parkour)"\Assassination.bat

    When I tested the above I typed restart and the windows disappeared but the batch file did not execute.

    Aside from the obvious (removing the spaces altogether) does anyone have a syntax fix for how to express the above path that Spigot.yml will be happy with?
     
  7. JoeGray100

    Supporter

    If I try to put quotes around the whole thing, Spigot spits out a bunch of errors upon loading Spigot.yml

    So, " C:\Assassination (parkour)\Assassination.bat" definitely does NOT work either.
     
  8. JoeGray100

    Supporter

    Got it, I just used Assassination.bat and it assumed the correct directory. Whew!
     
  9. I hate spaces in dir names on all OS. Glad Win 7 sanitised C:\Documents and Settings to become C:\Users .

    And plugin developers who write subdirectory names with spaces in them should get an SMS everytime I'm forced to redo a find ... | xargs command with find ... -print0 | xargs -0