PDA

Click to See Complete Forum and Search --> : Make a program run as a service


phishphreek
July 16th, 2004, 03:40 AM
This is a short "howto" make a program run as a service.

Windows 2000/XP/Etc

In my example I will be using Kiwi Syslog Daemon.
(Yes, I realize that there is already a service version... I just used this as my example.)

I downloaded and Installed Kiwi Syslog Daemon from http://www.kiwisyslog.com/
I just used the standard edition because I want to show how to make a program run as a service.

I'll attach the needed files in a zip. These files (instsrv.exe and srvany.exe) should be placed in the root directory of the program that you want to run as a service. These files are also included with the windows 2000 resource kit.

I installed mine to "C:\Program Files\syslogd"

From a command prompt:

I type


c:whatever comes up>cd \
c:> cd "C:\Program Files\Syslogd"
C:\Program Files\Syslogd>instsrv.exe syslogd "c:\Program Files\Syslogd\srvany.exe"


Note that the syslogd that I've bolded is what I've decided to name the service.
I know... I'm VERY creative. ;)

It should tell you that it was a success and that you have to make some changes in the registry.

Now, click on start, run and type regedit

Browse to:

HKLM\SYSTEM\CurrentControlSet\Services\syslogd

Right click and create a new key called Parameters.
Then browse to Parameters.

HKLM\SYSTEM\CurrentControlSet\Services\syslogd\Parameters

Right click and create a new String Value called "Application"

For the Data Value, type in the location of the program's executable.

C:\Program Files\Syslogd\syslogd.exe

Now you are ready to make it start.
You can browse to the service manager and manually start it, or you can reboot.

There you are. Its that easy to make a program run as a service.

NOTE: So far, whatever I'd tried... I am NOT able to end process on the process. I have to stop the service to kill it. You can start/stop the service from the service control manager or from CLI

net start servicename
net stop serrvicename

Yay!!! I've got mail! Yay!!!

The Grunt
July 16th, 2004, 04:57 AM
Great tutorial. Helped me with my question I had from a while back on how exactly to use the .exe's to make the program a service.

phishphreek
July 16th, 2004, 01:11 PM
Well, it looks as if this has already been done by HT.

http://antionline.com/showthread.php?s=&threadid=244583

I suppose I should have searched to see if it had been done.

Sorry HT, don't want you to think that I stole your material.

You can tell they are different... but the procedure is still the same.

If you want this deleted, I have no objections. :)

Have a good weekend!

HTRegz
July 16th, 2004, 08:16 PM
Hey Hey,

No need to have the tutorial deleted dude... I was just bugging ya.. :P I think it's a good tutorial because it's generalized, my was slightly different because it was dealing with DSL and PPPoE. I'll catch ya on AIM...

Peace,
HT

PS. You can make it up to me by sending me that router you got laying around :D j/k