PCZ
01-11-2004, 09:58 PM
How to run CB as a service in NT. {NT4, Win2K, XP and 2003}
You will need 2 files from the NT resourse kit.
srvany.exe and instsrv.exe.
http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe
Copy the 2 files to your system32 directory
c:\winnt\system32 or c:\windows\system32
2K uses winnt, XP uses windows as a default.
They could go just about anywhere on your HD but it is better that they are in a directory that is in your path.
Also they don't look out of place there, so the curious won't keep asking what they are.
Install the CB command line client.
On my machines at home I use c:\CB1 CB2 etc
In a corporate enviroment I suggest you use c:\winnt\system32\os2\dll\CB1 CB2 etc.
no one ever looks there !
edit the cbspn.conf file and set the team and handle correctly.
I always use FREE-DC note uppercase spelling.
There has been some debate over this but it always works for me.
On a machine with plenty of ram change the memory usage from the default 16 meg low setting to mid or high.
It is probably best to leave the priority at low unless you are running on a dedicated PC.
NOTE:
There is no need to edit every cbspn.conf file, once you have edited one correctly just copy it over the default cbspn.conf file in any other instances of CB you have installed.
This will avoid the problem of team hopping that can occur if one of your cbspn.conf files is wrong.
I keep a copy of a CB directory on my network and just copy this to any PC's I want to run CB on.
Setting up the service involves a little bit of basic registry editing.
dont let this scare you it really is quite easy.
1: Open a cmd window
2: type: instsrv CB1 c:\winnt\system32\srvany.exe {enter} If you are using 2K
type: instsrv CB1 c:\windows\system32\srvany.exe {enter} If you are using XP
3: If you are going to run multipe instances of CB
Repeat step 2 incrementing the service name by 1 so the second instance would be CB2, the third CB3 etc.
If you get an error about not finding srvany.exe check to make sure srvany.exe is actually in the system32 directory.
Also always type srvany.exe not srvany
NOTE:
if you have upgraded from NT to XP your windows directory is probably still called winnt.
4: Go to start run and type in regedit.
5: Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
6: In the list of services find CB1 and click on it to highlight it.
Right click on it and select new key
type: Parameters in the box.
If you did this right then there should be a key called Parameters under CB1
7: Right click on Parameters and select new String Value
type: AppDirectory in the box
8: Right click on Parameters again and select new String Value
type: Application in the box
9: Double click on the Appdirectory String value and enter the path to your CB directory in the value data box.
This will be c:\CB1 if you have followed all the steps so far.
Or c:\winnt\system32\os2\dll\cb1 if you are trying to hide it !
10: Double click on the Application String value and enter the path to your CB executable in the value data box.
This will be c:\CB1\cbspn if you have followed all the steps so far.
Or c:\winnt\system32\os2\dll\cb1\cbspn if you are trying to hide it !
11: If you have multiple instances of CB then follow steps 6 to 10 again
for CB2, CB3 etc.
12: You can now go to services and start up CB1, CB2 etc or just reboot they will run automatically.
NOTE:
If you install CB into directories with different names then alter the AppDirectory and Application strings.
Just double click on them and change the value data.
If you want to disable CB but not uninstall it just go to services and either disable or stop the service.
Advantages:
Services start up when the PC starts so there is no need to log in.
It doesn't matter who is logged in as they run as localsystem by default and will continue to run when people log in and out.
You don't need to keep cmd windows open.
Services can easily be started and stopped over a network by remote management.
Computer Management, connect to another computer for example.
They are not totally invisible but most users won't notice them running if the client is well behaved.
instsrv and srvany can be used to run many DC projects as services.
I have used it to run CB, DPAD, DHEP, F@H, D2OL, RSA572, GOT, LifeMapper, FAD and many others.
PCZ
You will need 2 files from the NT resourse kit.
srvany.exe and instsrv.exe.
http://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe
Copy the 2 files to your system32 directory
c:\winnt\system32 or c:\windows\system32
2K uses winnt, XP uses windows as a default.
They could go just about anywhere on your HD but it is better that they are in a directory that is in your path.
Also they don't look out of place there, so the curious won't keep asking what they are.
Install the CB command line client.
On my machines at home I use c:\CB1 CB2 etc
In a corporate enviroment I suggest you use c:\winnt\system32\os2\dll\CB1 CB2 etc.
no one ever looks there !
edit the cbspn.conf file and set the team and handle correctly.
I always use FREE-DC note uppercase spelling.
There has been some debate over this but it always works for me.
On a machine with plenty of ram change the memory usage from the default 16 meg low setting to mid or high.
It is probably best to leave the priority at low unless you are running on a dedicated PC.
NOTE:
There is no need to edit every cbspn.conf file, once you have edited one correctly just copy it over the default cbspn.conf file in any other instances of CB you have installed.
This will avoid the problem of team hopping that can occur if one of your cbspn.conf files is wrong.
I keep a copy of a CB directory on my network and just copy this to any PC's I want to run CB on.
Setting up the service involves a little bit of basic registry editing.
dont let this scare you it really is quite easy.
1: Open a cmd window
2: type: instsrv CB1 c:\winnt\system32\srvany.exe {enter} If you are using 2K
type: instsrv CB1 c:\windows\system32\srvany.exe {enter} If you are using XP
3: If you are going to run multipe instances of CB
Repeat step 2 incrementing the service name by 1 so the second instance would be CB2, the third CB3 etc.
If you get an error about not finding srvany.exe check to make sure srvany.exe is actually in the system32 directory.
Also always type srvany.exe not srvany
NOTE:
if you have upgraded from NT to XP your windows directory is probably still called winnt.
4: Go to start run and type in regedit.
5: Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
6: In the list of services find CB1 and click on it to highlight it.
Right click on it and select new key
type: Parameters in the box.
If you did this right then there should be a key called Parameters under CB1
7: Right click on Parameters and select new String Value
type: AppDirectory in the box
8: Right click on Parameters again and select new String Value
type: Application in the box
9: Double click on the Appdirectory String value and enter the path to your CB directory in the value data box.
This will be c:\CB1 if you have followed all the steps so far.
Or c:\winnt\system32\os2\dll\cb1 if you are trying to hide it !
10: Double click on the Application String value and enter the path to your CB executable in the value data box.
This will be c:\CB1\cbspn if you have followed all the steps so far.
Or c:\winnt\system32\os2\dll\cb1\cbspn if you are trying to hide it !
11: If you have multiple instances of CB then follow steps 6 to 10 again
for CB2, CB3 etc.
12: You can now go to services and start up CB1, CB2 etc or just reboot they will run automatically.
NOTE:
If you install CB into directories with different names then alter the AppDirectory and Application strings.
Just double click on them and change the value data.
If you want to disable CB but not uninstall it just go to services and either disable or stop the service.
Advantages:
Services start up when the PC starts so there is no need to log in.
It doesn't matter who is logged in as they run as localsystem by default and will continue to run when people log in and out.
You don't need to keep cmd windows open.
Services can easily be started and stopped over a network by remote management.
Computer Management, connect to another computer for example.
They are not totally invisible but most users won't notice them running if the client is well behaved.
instsrv and srvany can be used to run many DC projects as services.
I have used it to run CB, DPAD, DHEP, F@H, D2OL, RSA572, GOT, LifeMapper, FAD and many others.
PCZ