avatar

Andres Jaimes

How to manage local or remote services from command line

By Andres Jaimes

Starting or stopping services on Windows is a task commonly performed by using the Services snap-in on the MMC console. From time to time you want to perform such tasks from the command line. A possible reason for this is when you are creating scripts (batch files).

To achieve this, you have two options: net for managing local services and sc.exe for remote ones.

The net command is included in your default Windows installation. The sc.exe is installed as part of the Windows Resource Kit Tools. You can download it directly from here.

 

How to use them

To ask for help on the net command:

net help

To ask for help on the sc command:

sc /?

To ask for help on the net start command:

net help start

Check running services on your local computer from command line:

net start

Check running services on a remote computer from command line:

sc computer-name query

Start a service on your local computer:

net start "name of service"

Start a service on a remote computer:

sc computer-name start "name of service"

 

Visit the Microsoft website for a full explanation on the SC command.

You may also want to take a look at Netsvc.exe and Instsrv.exe.