Windows administrators can manage services via:
The Services snap-in, built upon Microsoft Management Console, can connect to the local computer or a remote computer on the network, enabling users to:6
The command-line tool to manage Windows services is sc.exe. It is available for all versions of Windows NT.9 This utility is included with Windows XP10 and later11 and also in ReactOS.
The sc command's scope of management is restricted to the local computer. However, starting with Windows Server 2003, not only can sc do all that the Services snap-in does, but it can also install and uninstall services.12
The sc command duplicates some features of the net command.13
The ReactOS version was developed by Ged Murphy and is licensed under the GPL.14
The following example enumerates the status for active services & drivers.15
The following example displays the status for the Windows Event log service.16
The Microsoft.PowerShell.Management PowerShell module (included with Windows) has several cmdlets which can be used to manage Windows services:
Windows also includes components that can do a subset of what the snap-in, Sc.exe and PowerShell do. The net command can start, stop, pause or resume a Windows service.25 In Windows Vista and later, Windows Task Manager can show a list of installed services and start or stop them. MSConfig can enable or disable (see startup type description above) Windows services.
Windows services are installed and removed via *.INF setup scripts by SetupAPI; an installed service can be started immediately following its installation, and a running service can be stopped before its deinstallation.262728
For a program to run as a Windows service, the program needs to be written to handle service start, stop, and pause messages from the Service Control Manager (SCM) through the System Services API. SCM is the Windows component responsible for managing service processes.
The Windows Resource Kit for Windows NT 3.51, Windows NT 4.0 and Windows 2000 provides tools to control the use and registration of services: SrvAny.exe acts as a service wrapper to handle the interface expected of a service (e.g. handle service_start and respond sometime later with service_started or service_failed) and allow any executable or script to be configured as a service. Sc.exe allows new services to be installed, started, stopped and uninstalled.29
"Services overview". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-us/library/cc783643%28v=ws.10%29.aspx ↩
"Services". Microsoft Developer Network. Microsoft. Retrieved 29 March 2013. http://msdn2.microsoft.com/en-us/library/ms685141.aspx ↩
"New Elevation PowerToys for Windows Vista". TechNet Magazine. Microsoft. June 2008. Retrieved 21 June 2013. The service CmdAsSystem is configured as interactive whose support is being deprecated. The service may not function properly. The problem is that this script tries to create and start an interactive service. Interactive services will not function correctly due to Session 0 Isolation in Windows Vista. https://technet.microsoft.com/en-us/magazine/2008.06.elevation.aspx ↩
"Services in Windows". MSDN. Microsoft. 18 October 2010. Retrieved 21 June 2013. http://msdn.microsoft.com/en-us/windows/hardware/gg463428.aspx ↩
"Start, stop, pause, resume, or restart a service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-us/library/cc736564%28v=WS.10%29.aspx ↩
"ServiceInstaller.DelayedAutoStart Property (System.ServiceProcess)". Microsoft. Retrieved 28 November 2017See Remarks section{{cite web}}: CS1 maint: postscript (link) http://msdn.microsoft.com/en-us/library/system.serviceprocess.serviceinstaller.delayedautostart.aspx ↩
"How to create a Windows service by using Sc.exe". Support. Microsoft. 11 September 2011. Retrieved 29 March 2013. http://support.microsoft.com/kb/251192 ↩
"Command-line reference A-Z: SC". TechNet. Microsoft. Retrieved 8 January 2014. https://technet.microsoft.com/en-us/library/bb490995.aspx ↩
"Command-Line Reference: Sc". TechNet. Microsoft. Retrieved 8 January 2014. Windows 7, Windows 8, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Vista https://technet.microsoft.com/en-us/library/cc754599.aspx ↩
SC - Service Control - Windows CMD - SS64.com https://ss64.com/nt/sc.html ↩
reactos/sc.c at master · reactos/reactos · GitHub https://github.com/reactos/reactos/blob/master/base/applications/sc/sc.c ↩
MS-DOS and Windows command line sc command https://www.computerhope.com/sc-command.htm ↩
"Get-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/library/hh849804.aspx ↩
"New-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849830.aspx ↩
"Restart-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849823.aspx ↩
"Resume-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849811.aspx ↩
"Set-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849849.aspx ↩
"Start-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849825.aspx ↩
"Stop-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849790.aspx ↩
"Suspend-Service". TechNet. Microsoft. Retrieved 29 March 2013. https://technet.microsoft.com/en-US/library/hh849791.aspx ↩
"Start, stop, pause, resume, or restart a service". TechNet. Microsoft. Retrieved 8 January 2014. https://technet.microsoft.com/en-us/library/cc736564%28v=ws.10%29.aspx ↩
"INF AddService Directive". Microsoft. Retrieved 10 July 2017. https://docs.microsoft.com/windows-hardware/drivers/install/inf-addservice-directive ↩
"SetupInstallServicesFromInfSection function". MSDN. Microsoft. Retrieved 10 July 2017. https://msdn.microsoft.com/library/aa377402.aspx ↩
"SetupInstallServicesFromInfSectionEx function". MSDN. Microsoft. Retrieved 10 July 2017. https://msdn.microsoft.com/library/aa377403.aspx ↩
"How To Create a User-Defined Service". Support. Microsoft. Retrieved 29 March 2013. http://support.microsoft.com/kb/137890 ↩