›› How do I manually control my Windows Services outside of the Services Control Panel?
If you wish to go outside the Service Control Panel to manually control your Windows Services, it's actually pretty easy. First, you need to get into your command prompt, also known as the command line. Here is how you do it:
You should now be in your command prompt. In order to control your services, you will use the Service Control (sc) command. SC is the command line interface to Windows Service management and it will allow you to create, start, stop, query, delete, etc... any Windows Service.
You should now see a screen that looks like this:
DESCRIPTION: SC is a command line program used for communicating with the NT Service Controller and services. USAGE: sc <server> [command] [service name] <option1> <option2>... The option <server> has the form "\\ServerName" Further help on commands can be obtained by typing: "sc [command]" Commands: query-----------Queries the status for a service, or enumerates the status for types of services. queryex---------Queries the extended status for a service, or enumerates the status for types of services. start-----------Starts a service. pause-----------Sends a PAUSE control request to a service. interrogate-----Sends an INTERROGATE control request to a service. continue--------Sends a CONTINUE control request to a service. stop------------Sends a STOP request to a service. config----------Changes the configuration of a service (persistant). description-----Changes the description of a service. failure---------Changes the actions taken by a service upon failure. qc--------------Queries the configuration information for a service. qdescription----Queries the description for a service. qfailure--------Queries the actions taken by a service upon failure. delete----------Deletes a service (from the registry). create----------Creates a service. (adds it to the registry). control---------Sends a control to a service. sdshow----------Displays a service's security descriptor. sdset-----------Sets a service's security descriptor. GetDisplayName--Gets the DisplayName for a service. GetKeyName------Gets the ServiceKeyName for a service. EnumDepend------Enumerates Service Dependencies. The following commands don't require a service name: sc <server> <command> <option> boot------------(ok | bad) Indicates whether the last boot should be saved as the last-known-good boot configuration Lock------------Locks the Service Database QueryLock-------Queries the LockStatus for the SCManager Database EXAMPLE: sc start MyService
In order to control your services, you will need to enter the correct syntax for the sc command, which is:
The <server> parameter is the server or computer on the network in which the service you want to control is running. The <server> parameter is optional; leave this blank if you are controlling services from the same computer. The [command] and [service name] parameters are not optional and must be filled in with a command and the name of the service you wish to control. The [service name] is usually the display name in the Service Control Panel. The <option1> and <option2> parameters go along with the create and config commands, which allow additional options to be set.
Here is an example of how you can use the sc command to start your Alerter service:
Another way to manually control your Windows Services is the NET command. The NET command is used to manage network resources and is able to start, stop, pause, and continue Windows Services. However, the sc command has many more options available to control services compared to the NET command.
If you would like to use the NET command, get into your command prompt as discussed above. From the command prompt:
You will see a screen like this:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
The syntax for the NET command is:
An example of how to stop the Messenger service using the NET command, would be:
If you would like to use the NET command to list all of the services on your machine that are currently running, here is what you do:
Fearful of losing money and clients due to Windows Service failures? Automatically restart your Windows Services with Service Hawk, and keep those services up and running!