Opentopia Directory Encyclopedia Tools

Windows Service

Encyclopedia : W : WI : WIN : Windows Service


Definition

A Windows service is an application that starts when Windows is booted and runs in the background as long as Windows is running. It is very similar to a Unix daemon.

Background

Windows provides an interface called the Service Control Manager that manages creating, deleting, starting and stopping of services. An application that wants to be a service needs to first be written in such a way that it can handle start|stop|pause|... messages from the windows service control manager. Then, in one or more API calls, the name of the service and other attributes such as its description are registered with the Service Control Manager.

Starting/Stopping/Modifying a Windows Service

Once a service is installed, its attributes can be modified by launching "Services" from the Windows Control Panel Administrative tools.

User Permissions and Implementation Considerations

Windows services by default are run as a virtual user: "LocalSystem" that has administrative rights on the system. The working directory will be the Windows system directory (typically C:\WINNT) and the default temp directory will typically be C:\WINNT\TEMP.

Since this is not a real user, this presents some challenges if user-specific data needs to be stored by the application, as there is no home directory for this user.

Windows services can be set up to run as any user although running as a user other than the default requires storing a password. It is important to consider that as soon as the password is changed, the service will not run unless the password provided for the service is also changed.

Outside Links

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: