Launching Any program as windows service Using Windows resource kit

0 comments
Steps For Launching the any program as windows service

prerequisite
1.Windows Resource kit.
Install resource kit to C:\RESKIT Directory

1.At a MS-DOS command prompt(running CMD.EXE), type the following command:

C:\RESKIT\INSTSRV.EXE My_Service_Name C:\RESKIT\SRVANY.EXE

NOTE: To verify that the service was created correctly, check the registry to verify that the ImagePath value under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\My_Service_Name
is set to point to SRVANY.EXE. If this is not set correctly, the service will stop shortly after it starts and return an Event ID 7000 "The service name failed to start."

2.Run Registry Editor (Regedt32.exe)and locate the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\My_Service_Name

3.From the Edit menu, click Add Key. Type the following and click OK:
Key Name: Parameters

4.Select the Parameters key.

5.From the Edit menu, click Add String 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 executable including the extension

6.From the Edit menu, click Add String Value. Type the following and click OK:
Value Name: AppDirectory
Data Type : REG_SZ
String : path

where "path" is the drive and full path to directory where the application application resides

7.Close Registry Editor.

8.Starting / Stopping service
- From the Services applet in Control Panel
- From a MS-DOS command prompt, type the following:
NET START My_Service_Name
NET STOP My_Service_Name

9.Testing whether My_Service_Name is started or not
Open task manager. Go to process tab.
When service is started then there should be two processes running "srvany.exe" and "My_Service_Name.exe"

10.Removing service
Open command prompt and run command

C:\RESKIT\INSTSRV My_Service_Name remove
If you like this post, please share it!
Digg it StumbleUpon del.icio.us Google Yahoo! reddit

No Response to "Launching Any program as windows service Using Windows resource kit"