Skip to Main Content
Windows Server Cookbook
book

Windows Server Cookbook

by Robbie Allen
March 2005
Intermediate to advanced content levelIntermediate to advanced
698 pages
19h 13m
English
O'Reilly Media, Inc.
Content preview from Windows Server Cookbook

Chapter 7. Services

Introduction

Windows services are nothing more than continually running processes that are controlled by the Service Control Manager (SCM). Instead of directly creating a service process, you (or the system itself) sends a start or stop message to the SCM, which takes care of starting or stopping the associated process. The DHCP Client provided with the Windows operating system is an example of a service. It is responsible for requesting and renewing DHCP requests (i.e., obtaining an IP address dynamically), and, interestingly, performing dynamic DNS registrations. After the system begins the boot-up process, the SCM starts the DHCP Client service, which kicks off a process that runs in the background to handle DHCP requests. You can stop the DHCP Client service via the Services snap-in, which causes the SCM to terminate the underlying DHCP Client process. If you start the service, the SCM starts the process.

Each service has a corresponding key in the Registry contained under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. This stores basic configuration information about the service including service dependencies, the command line to execute to start the service, and startup type (automatic, manual, or disabled). You can find the associated registry key for a service by running the following command:

> sc getkeyname "<ServiceDisplayName>"

For example, this returns the key for the DHCP Client service:

> sc getkeyname "DHCP Client" [SC] GetServiceKeyName SUCCESS ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows 10 Troubleshooting

Windows 10 Troubleshooting

Mike Halsey
Windows® Sysinternals Administrator’s Reference

Windows® Sysinternals Administrator’s Reference

Mark E. Russinovich and Aaron Margosis
Windows Server® 2012 Unleashed

Windows Server® 2012 Unleashed

Rand Morimoto, Michael Noel, Guy Yardeni, Omar Droubi, Andrew Abbate, Chris Amaris

Publisher Resources

ISBN: 0596006330Errata Page