Managing Services in Windows 7

Before you start

Objectives: Learn where to find and how to manage services in Windows 7.

Prerequisites: no prerequisites.

Key terms: services, start, stop, manage, startup, Windows 7

 Services Snap-in

To open the Services snap-in we can enter “services.msc” in the Search box. The snap-in with the list of services will appear.

 1 Services list

Services Console

In the Services console we right-click a service and then choose what to do with it. We can start it (if it is not running), stop it (if it is running), pause it, resume it and restart it.

 2 Right-Click Options

Right-click Options

We can also go to the properties of the service. When we do that, a new window will appear. On the General tab we can see the general information about the selected service and its startup type.

 3 General Tab Example

General Tab

Note that we can change the startup type here. The startup type can be “Automatic (delayed start)”, Automatic, Manual or Disabled. Services that are set to startup automatically will start at boot time. If the startup type is Automatic (delayed start), it starts just after the boot time which can result in faster boot. Keep in mind that some services require the startup type to be automatic in order to function properly. Manual startup type enables Windows to start a service when it is needed, and we can always start this service from the Services console by selecting the Start action. The Disabled startup type won’t allow service to start even when it is needed.

On the Log On tab we can see the account which is used to start the service.

 4 Log On Tab

Log On Tab

We can even browse and select a specific user account that we want for the service to run in. The next tab is the Recovery. Here we can select what the system will do if the service fails.

 5 Recovery Tab

Recovery Tab

We can specify an option if the service fails once, two times and for the subsequent failures. We can select to restart the service,  select to take no action, to restart the service, to run a program or to restart the computer. If we choose the Run a Program option, we will be able to specify the program that we want to execute and specify the command line parameters if we need. Note that programs that we specify here should not require user input. Otherwise the program will just stay open for the prompt for user intervention until the user responds to the prompt. If we choose the Restart the Computer option, we will be able to specify after how many minutes will the computer restart, and we can enter a message that will be shown to the user.

Note that on this window we also have an option to “Enable actions for stops with errors”. All options set here are for failures by default, but if we check the “Enable actions for stops with errors”, all those options will also apply for stops because of errors.

On the Dependencies we can see on which services our service depends on. We can also see services which depend on our selected service.

6 Dependencies

Dependencies Tab

For example, if our service won’t start, we can check if all the dependent services are started as working.

Services and CMD

We can also start and stop services from the command line (we have to run it as administrator). To start a service we use the “net start” command. To stop a service we use a “net stop” command. If we only enter “net start“, we will get a list of running services on our machine. To start or stop a service, we have to know its name. Services in Windows have two names – their easy-to-understand display names and their actual service names, which is how their configuration is stored in the registry. To get the service name, the easiest way is to run “sc query” command. This will list information about all the services on our machine, including the service name and the display name. This list is long,  so we should dump the results to a file by adding “> c:\file.txt” to the command and then search the file for the service.

 7 Starting The Service

Starting The Service Example

To do a restart of the service in the command line, we can combine the two mentioned commands using the “&&” symbol. The command will look like this: “net stop {service_name} && net start {service name}“.

Another command we can use to start or stop a service is “sc start” and “sc stop”. For example, to start a service named Apache2.4, we would enter the command “sc start Apache2.4“.  To stop it, we would enter “sc stop Apache2.4“.

 8 Stop Service

Stopping The Service Example

We can also use “sc” to do many other actions with Services. To see other available actions, enter “sc” in CMD and hit enter.