Starting, Stopping, or Restarting a Service Using Command Line

Any account with administrator privileges can start, stop, or restart a Windows service using either the GUI or by using the NET family of commands at the command line (very useful for writing scripts).

Start a service

Type net start <serviceName> (where <serviceName> is the service name). You can also use the display name of the service by enclosing it within quotes.

Stop a service

Type net stop <serviceName>

Restart a service

Type net restart <serviceName>

Pause a service

Type net pause <serviceName>

Batch File

I use this batch file to easily manage services (stop, start, whatever). Feel free to use/modify for your own use.

Save the file as service.bat and run from the command line by typing service <action> <serviceName> (where <action> is either start, stop, restart, or pause and <serviceName> is the service name).

@echo off


rem =============================================
rem SERVICE MANAGEMENT
rem
rem Description:
rem   This batch file will run at logon (from a
rem   scheduled task) and manage a service.
rem
rem Version . . . 1.00.0
rem Modified  . . 2011-01-24
rem Author  . . . Peter Lindstrom
rem               
rem =============================================

cls
echo. 
echo. 
echo. 
echo. 
color f0
echo               *   *   *   *   *   *   *   *   *   *   *   *   *   *
echo               %1 service %2
echo               *   *   *   *   *   *   *   *   *   *   *   *   *   *
echo. 
echo. 
echo. 
echo. 
echo Please wait...
ping 127.0.0.1 -n 10 -w 1000 > NUL
net %1 %2
echo. 
echo. 
echo Finished.  Press any key to exit...
pause > NUL
cls
color
		

Creative Commons License