Thread: Restart of server in launcher code with CMD

Results 1 to 2 of 2
  1. #1 Restart of server in launcher code with CMD 
    Registered Member
    Join Date
    Jun 2014
    Posts
    90
    Thanks given
    4
    Thanks received
    4
    Rep Power
    0
    In my Launcher I have this code:

    Code:
    public static void restart() { 
    		closeServices(); System.gc(); 
    		try { Runtime.getRuntime().exec("cmd /c start run.bat"); 
    		System.exit(0);} // temp usualy 2 } 
    		catch (Throwable e) { Logger.handle(e);
    		}			
    	}
    I need it to open a run.bat file in c:\data\run.bat , how can I modify this code to do this. Will rep .

    ~ Jango
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2012
    Posts
    286
    Thanks given
    7
    Thanks received
    49
    Rep Power
    25
    I think it would be "cmd /c start ../../data/run.bat" (unless the data folder is in the system path variables) the / s might be \ s. I don't have a windows machine nearby at the moment so can't test.

    Hope this helped
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 28
    Last Post: 06-09-2014, 04:08 PM
  2. Replies: 1
    Last Post: 08-18-2012, 02:21 AM
  3. [NON] Name of server in corner like Barrows.
    By DaraX in forum Tutorials
    Replies: 23
    Last Post: 05-03-2012, 04:00 PM
  4. Restart your server, with a command
    By Nour in forum Tutorials
    Replies: 51
    Last Post: 01-21-2008, 05:51 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •