Managing Services Using the Sc.exe Command
You can use the Sc.exe command to start, stop, configure, and manage various aspects of services in the same way that you can on earlier versions of Windows. The Sc.exe command provides administrators with far more flexibility in configuring services than the Services snap-in or Group Policy.
The Sc.exe command was previously enhanced in Windows Vista with additional command-line switches, including the following:
- New switches for specifying required privileges for a service, including:
- privs Sets the required privileges for a service
- qprivs Queries for the required privileges of a service
- New switches that support per-service SIDs, including:
- sidtype Changes a service's SID
- qsidtype Retrieves the setting for a service's SID
- New switches to enable configuration of the FailureActionsOnNonCrashFailures
setting, including:
- failureflag Changes the setting of the FailureActionsOnNonCrashFailures flag
- qfailureflag Retrieves the setting for the FailureActionsOnNonCrashFailures flag
- showsid Displays the service SID string corresponding to an arbitrary name
- stop This is an old setting that was enhanced in Windows Vista to specify the stop reason. This setting enables postmortem reliability analysis to find an administrator's reasons (by examining the event logged by SCM with the stop reason) for stopping a service.
New in Windows 7 are command options for Sc.exe that allow configuring and querying a service for supported triggers. For information about how to use these new command options, see the sidebar titled "Direct from the Source: Sc.exe Command Support for Service Triggers" later in this tutorial.
For more information about the command-line switches for Sc.exe, type sc /? at a command prompt.
In this tutorial:
- Managing Devices and Services
- Understanding Device Installation and Management
- Device Enhancements in Windows 7
- Display Enhancements in Windows 7
- Understanding Device Installation
- Driver Store and Driver Packaging
- Driver Staging vs Installation
- Driver Staging and Installation Process
- Detailed Installation Process
- Managing Driver Packages
- Using PnPutil.exe
- Using Dism.exe
- Driver Signing
- Driver Ranking
- Installing and Using Devices
- Enhancements to the Device Installation Experience in Windows 7
- Scenario 1: Driver found in Driver Store
- Scenario 2: Driver found on Windows Update
- Scenario 3: Driver in Driver Store, But Better Driver on Windows Update
- Scenario 5: No Driver Can Be Found for the device
- Scenario 6: Vendor -supplied media is available
- Scenario 7: Additional Device Software is Available For Download from vendor
- Configuring Device Installation Settings
- Using the Devices And Printers Folder
- Understanding Device Stage
- Understanding the Device Experience Architecture
- Device Containers
- Device display object
- Device Metadata System
- Managing Device Installation Using Group Policy
- Managing Device Installation Behavior
- Managing Driver Installation Behavior
- Blocking Installation of Removable Devices
- Managing Device Redirection Behavior
- Troubleshooting Device Installation
- Using Windows Error Reporting
- Using the SetupAPI Log File
- Using Driver INF Files
- Using Device Manager Error Codes
- Using Driver Verifier
- Repairing Driver Store Corruption
- Repairing Index File Corruption
- Understanding Power Management
- Power Management Enhancements in Windows 7
- New Power Policies in Windows 7
- Configuring Power Management Settings
- Configuring Power Management Settings Using the Power Options Utility in Control Panel
- Configuring Power Management Settings Using Group Policy
- Configuring Power Management Settings Using the Powercfg Utility
- Understanding Services
- Service Enhancements in Windows 7
- Managing Services
- Managing Services Using Task Manager
- Managing Services Using the Sc.exe Command