This is a relatively easy thing to do, and you don't have to purchase any programs to do it- the old fashioned srvany approach works perfectly. I will now explain in detail what exactly the srvany approach is.
Before we begin, make sure you're starting your server with a batch (.BAT) file, and that it starts in console mode. This will not work any other way. To do this, simply open notepad, and type this into it:
c:
cd\<The Name of the folder in which your srcds.exe resides>
start /high c:\<The Name of the folder in which your srcds.exe resides>\srcds.exe <-vacbeta> -console -game <gametype- such as cstrike for CS:S> +map de_dust2 -maxplayers <However many players you wish to have>
Save this file as "run.bat" in your Source server directory.
Now, on to making the service.
Step 1: Download INSTSRV.EXE and SRVANY.EXE to a directory you can remember on your windows box. For this example, we will put the files in a folder "service" on the root of the C: drive. (C:\service)
Step 2: Open up a dos prompt (click start, run, type "cmd" and hit enter), and go to the directory in which the two files reside (in our example, you would type "cd\service").
Once in the directory, type "INSTSRV SRCDS c:\service\srvany.exe" (of course replacing c:\service with wherever you put the programs). (You can also rename "SRCDS[" with anything you choose- This is the name of the service as it will appear in your list of services.)
Step 3: Close the DOS window by typing EXIT. Now open Regedit (click Start, Run, and typing "Regedit" and press enter). In the folder structure, open the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Scroll down until you find your service, (which we named in our example "SRCDS"). Open this folder as well.
Step 4: On the menu bar for regedit, click on the "edit" menu, and select "new" and "key". a new folder will apear. Name it "Parameters". Open the folder, and add a new string value (click edit, new, string value). A file will appear in the folder. Name it "Application". Then, Right click on "Application", and click "modify".
In the Value data box, type in the path to your Source Server's bat file. In our case, it was the default, so we would type C:\hl2server\run.bat
Then click OK.
Your server is now ready to run as a service! Simply open the services control panel (either in control panel/administrative tools, or just click start, run, and type "services.msc" and hit enter).
You can set when your server starts and other such things from this panel- just find your server in the list.
That's it!
NOTE: Due to the hacked nature of this service setup, stopping the service WILL NOT stop the server. To stop the server manually, simply open up the task manager (CTRL+ALT+DELETE), and find SRCDS.EXE and end the task manually.
Let me know if you have any problems! The files I posted are old versions, but they should still do the trick well enough.
DarkZealot89 Wrote:I think I will try to run it as a service, but I dont mind having 2 cmd windows open like so:
If you don't mind having two windows open, then there's no need to run the server as a service. However, if you like being able to log out of your system without killing your server (or have your server start up with your computer before you log in), Service is the way to go.
you can use mean server loader as well.. it starts it as a service.. meaning basically it will run the server as soon as the computer starts.. even if the user is not logged in.. meaning you can log in, out.. whatever.. it will always run.. and if the server crashes.. it will automatically restart it.. it works great for me...AND you can acces the console screen. cuz its there.. if you log on.. http://www3.telus.net/mean/mean/04_serverloader.html theres the link.. i think it works great! it will also start up like srcdsfpsbooster at the same time if u want... and will even completly hide that.. cuz theres really no reason to have it open... works really nicely fo me..
I did use your service instructions, however I used them to take the srcdsfps_boost program and have that run in the background. All you have to do is specify the exe of the srcdsfps_boost program INSTEAD of a server .bat file in the registery.
is there anyway i could get a .bat file or service program that would shut down the server without asking if i wanted to shut it down,then reboot later?
10-10-2008, 06:26 PM (This post was last modified: 10-10-2008, 06:28 PM by Wrecked.)
solei Wrote:This is a relatively easy thing to do, and you don't have to purchase any programs to do it- the old fashioned srvany approach works perfectly. I will now explain in detail what exactly the srvany approach is.
Before we begin, make sure you're starting your server with a batch (.BAT) file, and that it starts in console mode. This will not work any other way. To do this, simply open notepad, and type this into it:
c:
cd\<The Name of the folder in which your srcds.exe resides>
start /high c:\<The Name of the folder in which your srcds.exe resides>\srcds.exe <-vacbeta> -console -game <gametype- such as cstrike for CS:S> +map de_dust2 -maxplayers <However many players you wish to have>
Save this file as "run.bat" in your Source server directory.
Now, on to making the service.
Step 1: Download INSTSRV.EXE and SRVANY.EXE to a directory you can remember on your windows box. For this example, we will put the files in a folder "service" on the root of the C: drive. (C:\service)
Step 2: Open up a dos prompt (click start, run, type "cmd" and hit enter), and go to the directory in which the two files reside (in our example, you would type "cd\service").
Once in the directory, type "INSTSRV SRCDS c:\service\srvany.exe" (of course replacing c:\service with wherever you put the programs). (You can also rename "SRCDS[" with anything you choose- This is the name of the service as it will appear in your list of services.)
Step 3: Close the DOS window by typing EXIT. Now open Regedit (click Start, Run, and typing "Regedit" and press enter). In the folder structure, open the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Scroll down until you find your service, (which we named in our example "SRCDS"). Open this folder as well.
Step 4: On the menu bar for regedit, click on the "edit" menu, and select "new" and "key". a new folder will apear. Name it "Parameters". Open the folder, and add a new string value (click edit, new, string value). A file will appear in the folder. Name it "Application". Then, Right click on "Application", and click "modify".
In the Value data box, type in the path to your Source Server's bat file. In our case, it was the default, so we would type C:\hl2server\run.bat
Then click OK.
Your server is now ready to run as a service! Simply open the services control panel (either in control panel/administrative tools, or just click start, run, and type "services.msc" and hit enter).
You can set when your server starts and other such things from this panel- just find your server in the list.
That's it!
NOTE: Due to the hacked nature of this service setup, stopping the service WILL NOT stop the server. To stop the server manually, simply open up the task manager (CTRL+ALT+DELETE), and find SRCDS.EXE and end the task manually.
Let me know if you have any problems! The files I posted are old versions, but they should still do the trick well enough.
you don't need to set the bat.
just type
instsrv srcds disk/path/srvany.exe
and then regedit
srcds / parameters key
add 3 strings.
application
appdirectory
appparameters
where application is disk/path/srcds.exe
appdirectory disk/path
apparameters -console -game cstrike -tickrate 100 -map de_dust2 -port 1337
etc,etc, etc
this way you dont need to ctrl+alt+del, u can just cmd: net stop srcds net start srcds.