I am using Windows XP on my laptop. I would like to create a new service which can be used in Windows. But I don't know how to do so in Windows XP. Can you help me how can I create a user-defined service on my Windows XP laptop?
Printable View
I am using Windows XP on my laptop. I would like to create a new service which can be used in Windows. But I don't know how to do so in Windows XP. Can you help me how can I create a user-defined service on my Windows XP laptop?
The Windows Server 2003 Resource Kit provides two utilities that allow you to create a user-defined service for Windows applications. Instrsrv.exe installs and removes system services and Srvany.exe allows any Windows application to run as a service.
To create a user-defined service, perform the following steps:
1. At the command prompt, type the following command:
where path is the drive and directory of the Windows Server 2003 Resource Kit and My Service is the name of the service you are creating.Code:path\INSTSRV.EXE My Service path\SRVANY.EXE
2. Run Registry Editor and navigate to the following subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<My Service>
3. From the Edit menu, click Add Key. Type the following and click OK:
Key Name: Parameters
Class : <leave blank>
4. Select the Parameters key.
5. From the Edit menu, click Add Value. Type the following and click OK:
Value Name: Application
Data Type : REG_SZ
String : <path>\<application.ext>
where <path>\<application.ext> is the drive and full path to the application's executable including the extension
6. Close Registry Editor.
You can even use sc.exe command.
SC is a command line program used for communicating with the NT Service Controller and services.
Syntax:
SC Commands:Quote:
sc <server> [command] [service name] <option1> <option2>...
query-----------Queries the status for a service, or enumerates the status for types of services.
queryex---------Queries the extended status for a service, or enumerates the status for types of services.
start-----------Starts a service.
pause-----------Sends a PAUSE control request to a service.
interrogate-----Sends an INTERROGATE control request to a service.
continue--------Sends a CONTINUE control request to a service.
stop------------Sends a STOP request to a service.
config----------Changes the configuration of a service (persistant).
description-----Changes the description of a service.
failure---------Changes the actions taken by a service upon failure.
qc--------------Queries the configuration information for a service.
qdescription----Queries the description for a service.
qfailure--------Queries the actions taken by a service upon failure.
delete----------Deletes a service (from the registry).
create----------Creates a service. (adds it to the registry).
control---------Sends a control to a service.
sdshow----------Displays a service's security descriptor.
sdset-----------Sets a service's security descriptor.
GetDisplayName--Gets the DisplayName for a service.
GetKeyName------Gets the ServiceKeyName for a service.
EnumDepend------Enumerates Service Dependencies.
To create a service, simply use
commandCode:<path>\sc.exe create "Service Name" binPath= "C:\Your Program.exe"