Windows Service
Encyclopedia
On Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s, a Windows service is a long-running executable that performs specific functions and which is designed not to require user intervention. Windows services can be configured to start when the operating system is booted
Booting
In computing, booting is a process that begins when a user turns on a computer system and prepares the computer to perform its normal operations. On modern computers, this typically involves loading and starting an operating system. The boot sequence is the initial set of operations that the...

 and run in the background as long as Windows is running, or they can be started manually when required. They are similar in concept to a Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

. Many appear in the processes list in the Windows Task Manager
Windows Task Manager
Windows Task Manager is a task manager application included with the Microsoft Windows NT family of operating systems that provides detailed information about computer performance and running applications, processes and CPU usage, commit charge and memory information, network activity and...

, most often with a username of SYSTEM, LOCAL SERVICE or NETWORK SERVICE, though not all processes with the SYSTEM username are services. The remaining services run through svchost.exe
Svchost.exe
In the Windows NT family of operating systems, svchost.exe is a system process which hosts multiple Windows services. Its executable image, %SystemRoot%\System32\Svchost.exe or %SystemRoot%\SysWOW64\Svchost.exe runs in multiple instances, each hosting one or more services...

 as DLLs loaded into memory.

Managing services

Once a service is installed, it can be managed by launching "Services" from the Windows Control Panel
Control Panel (Windows)
The Control Panel is a part of the Microsoft Windows graphical user interface which allows users to view and manipulate basic system settings and controls via applets, such as adding hardware, adding and removing software, controlling user accounts, and changing accessibility options...

 → Administrative Tools or typing "Services.msc" in the Run command on Start menu
Start menu
The Start Menu and Start Button are user interface elements used in the later versions of the Microsoft Windows operating systems and in some X window managers...

. In Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

 and later, it can be started or stopped in the Services tab in Windows Task Manager
Windows Task Manager
Windows Task Manager is a task manager application included with the Microsoft Windows NT family of operating systems that provides detailed information about computer performance and running applications, processes and CPU usage, commit charge and memory information, network activity and...

, and its process can also be found. The "Services" management console provides a brief description of the service functions and displays the path to the service executable, its current status, startup type, dependencies and the account under which the service is running. It enables users to:
  • Start, stop, pause or restart services.
  • Specify service parameters.
  • Change the startup type which includes Automatic, Manual and Disabled:
    • Automatic starts the services at system logon,
    • Manual starts a service as required or when called from an application (according to definition, but only some of the time in practice, depending on the service),
    • Disabled completely disables the service and prevents it and its dependencies from running.
    • Automatic (Delayed) is a new startup type introduced in Windows Vista, that starts the service a short while after the system has finished booting and initial busy operations, so that the system boots up faster.
  • Change the account under which the service logs on.
  • Configure recovery options upon service failure.
  • Export the list of services as a text file or a CSV
    Comma-separated values
    A comma-separated values file stores tabular data in plain-text form. As a result, such a file is easily human-readable ....

     file.


In Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...

 Service Pack 3 and Windows Vista
Windows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...

, besides the Services management console, users can manipulate services using MSConfig
MSConfig
MSConfig is a system utility to troubleshoot the Microsoft Windows startup process...

. The use of MSConfig to manage services, however, causes a prompt on the next startup. MSConfig can hide all operating system services for troubleshooting. Users can also use the SC command in the command prompt.

Developing a Windows service

A Windows Service is created using development tools such as Microsoft Visual Studio
Microsoft Visual Studio
Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop console and graphical user interface applications along with Windows Forms applications, web sites, web applications, and web services in both native code together with managed code for all...

 or Embarcadero Delphi . Windows provides an interface called the Service Control Manager
Service Control Manager
Service Control Manager is a special system process under Windows NT family of operating systems, which starts, stops and interacts with Windows service processes. It is located in %SystemRoot%\services.exe executable...

 that manages the 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, and pause messages from the Service Control Manager. Then, in one or more API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 calls, the name of the service and other attributes such as its description are registered with the Service Control Manager. Although typically services do not have a user interface, developers can add form
Form (programming)
In component-based programming , a form is an easy way to create a GUI window. A form contains components and controls, which are a high-level representation of standard GUI widgets; it's easier to manipulate the high-level wrappers than to deal with the underlying API.At design time, visual...

s and other UI
User interface
The user interface, in the industrial design field of human–machine interaction, is the space where interaction between humans and machines occurs. The goal of interaction between a human and a machine at the user interface is effective operation and control of the machine, and feedback from the...

 components. In this case, the "Allow service to interact with desktop" should be checked on the Logon tab in the Service properties dialog (though care should be taken with this approach as this can cause a security risk since any logged in user would be able to interact with the service).

See also

  • Daemon (computer software)
    Daemon (computer software)
    In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

  • List of Windows Services
  • Operating System Service Management
    Operating system service management
    In computing, mechanisms and techniques for managing services often differ by operating system. Operating system service management can refer to the following:...

  • Service Control Manager
    Service Control Manager
    Service Control Manager is a special system process under Windows NT family of operating systems, which starts, stops and interacts with Windows service processes. It is located in %SystemRoot%\services.exe executable...

  • Windows Service Hardening
  • Service Wrapper
    Service Wrapper
    A service wrapper is a computer program that wraps arbitrary programs thus enabling them to be installed and run as Windows Services or Unix Daemons, programs that run in the background, rather than under the direct control of a user. They are often automatically started at boot time...

  • Web Service
    Web service
    A Web service is a method of communication between two electronic devices over the web.The W3C defines a "Web service" as "a software system designed to support interoperable machine-to-machine interaction over a network". It has an interface described in a machine-processable format...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK