Forum Home
Press F1
 
Thread ID: 38960 2003-10-23 04:47:00 creating a system service in XP agent (30) Press F1
Post ID Timestamp Content User
185866 2003-10-23 04:47:00 I'm sure I've heard it somewhere, and I couldn't find anything in a Google search, but is it possible to register applications as a system service?

You see, as I run Windows XP Professional, there is really no super-easy way to integrate GPG and Outlook Express, or most other free mail clients I've looked at, for that matter.

In my current setup, I pass my emails to the virus scanner, which sends them to GPGrelay, which do it's thing and send on the emails. However, this program has it's limitations - there is a shortcut to it in the Startup folder, and it is launched to the system tray where it sits awaiting mail.

But I would prefer to have it running as a service in the background, if this is possible, because at the moment it is just wasting resources - I actually have at least eight items in the system tray all the time, but I permanently hide most of those, so decreasing that count would be a nice thing.
agent (30)
185867 2003-10-23 05:22:00 Agent,
I have done this in the past and offer the following method:

The following example uses the srvany.exe and instsrv.exe programs from the
MS Windows Resource Kit available as a download if not already available.

A command script has been used to create and install the service along with
a registry file to implement the parameters for the service.
Although you can setup the service and then modify the parameters through the
Computer Management services mmc snapin. (Dependencies, startup type, logon, recovery etc)

Cheers, Babe.

CMD script:

@echo Off
::
:: Make sure we have all our files in the appropriate directory e.g. C:\UTILS\TOOLS
:: the required files are:
:: MyService.cmd (this file)
:: Srvany.exe runs applications as a service (Applications as Services Utility from the resource kit)
:: Instsrv.exe the Service Installer program (from the resource kit)
:: MyService.vbs the main code of the MyService program or the EXE itself or whatever you want
:: MyServiceh.reg registry parameter file for service
::
:: Now set up the installed service on this computer
::
echo Installing MYSERVICE program as a service...
instsrv MyService C:\Utils\Tools\srvany.exe >NUL
::
:: Use the following MyService registry file to setup the parameters needed.
::
regedit /s C:\Utils\Tools\MyService.reg
::
:: Now start the service MyService
::
echo Starting the MYSERVICE service...
net start MyService
::

REG file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\MyService\Parameters]
"Application"="C:\\UTILS\\TOOLS\\MyService.WhatEver"
"AppParameters"=""
"AppDirectory"="C:\\UTILS\\TOOLS"
"AppEnvironment"=""
Babe Ruth (416)
185868 2003-10-23 06:34:00 Uh, ok, sounds... straightforward :D

But I can't find the Windows Resource Kit... I can find XP Pro Resource Kit, 98 Resource Kit, NT Resource Kit, etc. And I couldn't find a download for the XP Resource Kit, either.

?:|
agent (30)
185869 2003-10-23 19:35:00 Agent,

Use the Windows server 2003 resource kit downloads they work all ok ... link is Windows Deployment and Resource Kits (www.microsoft.com)

Cheers, Babe.
Babe Ruth (416)
185870 2003-10-28 07:49:00 agent,

Just a quick update... did you manage to get your XP service working ok?

Cheers, Babe.
Babe Ruth (416)
1