how to create a service from an exe on windows xp 2000 nt : executable to daemon mode

| | TrackBacks (0)

C:\> Instsrv.exe srvany c:\windows\system32\srvany.exe
C:\> regedt32

navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srvany

run-executable-as-service-windows-xp.gif

Create a New Key: Parameters
Under this create New string values:
"Application"="C:\\system32\\notepad.exe"
"AppDirectory"="C:\\"
"AppParameters"="C:\\test.txt"

back at your prompt type:
C:\> compmgmt.msc

Click:
Services and Applications -- Services

get the properties on srvany

run-executable-as-service-windows-xp-compmgmt.gif

Click the Log On tab

check the box:
Allow Service to interact with the desktop

run-executable-as-service-windows-xp-compmgmt-log-on.gif

This doesn't seem as relevant:

How to Create a Windows Service Using Sc.exe

There is a commandline option to turn a windows .exe into a running service, so if you want to try this look at sc.exe:

Update:
How To Create a User-Defined Service

The Windows NT Resource Kit provides two utilities that allow you to create a Windows NT user-defined service for Windows NT applications and some 16-bit applications (but not for batch files).

Instrsrv.exe installs and removes system services from Windows NT and Srvany.exe allows any Windows NT application to run as a service.


Creating Services:
Adding Service (Note: Space between binpath= and "C:\ has to be there.
C:\>sc.exe create "myServiceName" binPath= "C:\myService.exe"
Removing Service
C:\>sc.exe delete "myServiceName"

Controlling Services:
Starting Service
C:\>sc.exe start "myServiceName"
Pausing Service
C:\>sc.exe pause "myServiceName"
Stoping Service
C:\>sc.exe stop "myServiceName"

You can use Sc.exe to help develop services for Windows. Sc.exe, which is provided in the Resource Kit, implements calls to all of the Windows service control application programming interface (API) functions. You can set the parameters to these functions by specifying them on the command line. Sc.exe also displays service status and retrieves the values stored in the status structure fields. The tool also lets you specify the name of a remote computer so that you can call the service API functions or view the service status structures on the remote computer.

0 TrackBacks

Listed below are links to blogs that reference this entry: how to create a service from an exe on windows xp 2000 nt : executable to daemon mode.

TrackBack URL for this entry: http://www.kennethhunt.com/mt/mt-tb.cgi/1642

About this Entry

This page contains a single entry by klsh published on January 30, 2006 12:22 PM.

Audio from the Lua Workshop 2005 now available was the previous entry in this blog.

Iran's oil bourse draws little attention in West is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.