Running as a Service on MS WindowsCan I run a Haxial program as a Windows Service?Yes. "Srvany.exe" is a program included in the Microsoft Windows NT Resource Kit (but may also be used on both Windows 2000, XP, and Server 2003) which allows you to run almost any program as a Service. Services are programs that run behind the curtains of your system regardless of whether you log off, or never log in at all. "Srvany.exe" acts as a "wrapper" for the actual application you wish to run (such as KDX Server). See instructions following. Alternatively, if you do not want to use Srvany.exe for some reason, here are third-party programs which do much the same thing (allow you to run regular programs as Windows Services):
Using SRVANY to run as a ServiceTo install KDX Server as a Windows Service using Srvany and Instsrv, follow the steps below: 1. Obtain the Srvany.exe and Instsrv.exe programs from the Windows NT Resource Kit, or download here. Alternatively, you can download Srvany.exe from Microsoft at the following location, but note that it is a self-extracting archive, so you need to run it to obtain the real Srvany.exe file. ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/srvany_x86.exe 2. For this example, we will assume your KDX server is located at "C:\Program Files\KDX Server\KDXServer.exe". However, there is no problem with having yours in a completely different location. Simply replace the applicable locations we use in this tutorial with wherever your server is located. 3. Place a copy of both "Srvany.exe" and "Instsrv.exe" into your KDX Server folder ("C:\Program Files\KDX Server\"). It is also valid to place these executables into your Windows folder, but for simplicity purposes, we are going to both assume and suggest you simply place them into the same folder as your KDXServer.exe. 4. Open a command prompt (click the Start menu, choose Programs, then Accessories, then MS-DOS Prompt. OR Start menu, choose Run, type "command", and click OK). In the command prompt window, type these commands INCLUDING the quotes: cd "C:\Program Files\KDX Server\" 5. Run regedit.exe (click the Start Menu, choose Run, then type "regedit", and click OK) and browse to: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\KDXServerThis "Key" (as it is called in the registry) was created by Instsrv when you executed that previous command; This is what Instsrv does for is. Without it, we would have had to create all of these Keys and Values ourselves. WARNING: Using RegEdit incorrectly can cause serious problems that may require you to reinstall your operating system. Use it at your own risk. 6. Second-click on the "KDXServer" key and click New -> Key. This will create a new sub-key under that key; Name it "Parameters" (without quotes). 7. Second-click on the "Parameters" key and click New -> String Value. This will create a new "Value" inside of that key; Name it "Application" (without quotes). 8. Double-click the Value for "Application" and enter the location of your KDXServer.exe -- for our tutorial we will enter "C:\Program Files\KDX Server\KDXServer.exe" (without quotes). 9. Now, open your Services control panel (located in the Administrative Tools folder) and look for your newly created KDXServer service. Each individual service can be set to start up in a different manner. Second-click on the new service and click on "Properties" and you will see a dropdown list labeled "Startup Type" amongst other things. The 3 different settings are:
10. You may now close the properties window, and unless you set your service to "Disabled" (which would be silly, after all, KDX is great) you may now second-click on it and click "Start". 11. You can now log off and attempt to connect to your server from another computer, and it should work.
When I log off, my KDX Server exits / stops working, even though it is supposed to be running as a serviceOpen your Services control panel, second-click on your KDXServer and click on properties. Click on the "Log On" tab up top. Make sure the "Allow service to interact with desktop" checkbox is NOT checked. Due to a restriction enforced by Windows on services, the program can either be interactive (have a Console, read keyboard input etc) or have network access (but not both at the same time).
|