Jump to content

Windows service: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 18: Line 18:
*[http://support.microsoft.com/default.aspx?scid=kb;en-us;137890 INSTSRV.EXE is a Windows resource kit program that allows you to install an arbitrary application as a service ]
*[http://support.microsoft.com/default.aspx?scid=kb;en-us;137890 INSTSRV.EXE is a Windows resource kit program that allows you to install an arbitrary application as a service ]
*[http://www.iopus.com/guides/srvany.htm SrvAny and InstSrv Tutorial with many Screenshots]
*[http://www.iopus.com/guides/srvany.htm SrvAny and InstSrv Tutorial with many Screenshots]
*[http://pcs.suite101.com/article.cfm/index_of_services An Index of the Services running on Windows XP operating system ]
*[http://pcs.suite101.com/article.cfm/index_of_services] An Index of the Services running on Windows XP operating system


[[Category:Windows components]]
[[Category:Windows components]]

Revision as of 04:45, 20 September 2006

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 in concept 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.