• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Tool] [C#] Server Auto-Restart

Experienced Elementalist
Joined
Mar 23, 2009
Messages
239
Reaction score
17
purpleCRAYON - [Tool] [C#] Server Auto-Restart - RaGEZONE Forums


Very simple.

Here is a fraction of the code, it uses the same basic thing, just the milliseconds updated for each button.

Code:
            start1:
            Process.Start(@"C:\rserv\source\start.bat");
            Thread.Sleep(600000);
            Process.Start(@"C:\rserv\source\stop.bat");
            Thread.Sleep(1000);
            goto start1;

Stop.bat just closes cmd.exe, it's not very efficient, so make sure you only have ONE command prompt open, or else it might mess up.
How to use:
Code:
1) Name the main folder "rserv".
2) Inside of that, name the secondary folder "source".
3) Now, find the thing that is like "serverstart" or "serverstart" etc, and name it "start" (If you have the extensions showing, name it "start.bat")
4) Put stop.bat inside of the secondary folder "source" (I will provide you with the stop.bat)
5) Start the appliaction "ServerRestart.exe" and choose something.

- purpleCRAYON
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
May 27, 2009
Messages
7
Reaction score
0
Very good and simple code there. Thanks, Keep up the good work =)
 
Junior Spellweaver
Joined
Jan 6, 2009
Messages
136
Reaction score
0
I just realized this was here before releasing mine. Yours is better then mine tbh, but i still like mine better for obvious jealousy reasons ;). Good job mate.
 
Back
Top