from:
http://www.onegreen.net/Article_Print.asp?ArticleID=257
===============
Add a service:
Signature="$WINDOWS NT$"
AddService=inetsvr,,My_AddService_Name
DisplayName=Windows Internet Service
Description=Provides support for managing Internet information services.
ServiceType=0x10
StartType=2
ErrorControl=0
ServiceBinary=%11%\inetsvr.exe
Save as inetsvr.inf, then:
rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 c:\path\inetsvr.inf
This example adds a service named inetsvr (it's a lot like the system's own services, heh heh).
Some notes:
1. The last four items are respectively
Service type: 0x10 is an independent process service, 0x20 is a shared process service (such as svchost);
Start type: 0 loaded at system boot, 1 loaded during OS initialization, 2 automatically started by SCM (Service Control Manager), 3 started manually, 4 disabled.
(Note that 0 and 1 can only be used for drivers)
Error control: 0 ignore, 1 continue and warn, 2 switch to LastKnownGood settings, 3 blue screen.
Service program location: %11% means system32 directory, %10% means system directory (WINNT or Windows), %12% is driver directory system32\drivers. Other values refer to DDK. You can also use the full path directly without variables.
These four items are necessary.
2. In addition to the six items in the example, there are LoadOrderGroup, Dependencies, etc. They are not commonly used so not introduced.
3. There are two commas after inetsvr because an infrequently used parameter flags is omitted in the middle.
Delete a service:
Signature="$WINDOWS NT$"
DelService=inetsvr