How can I start, stop, or pause Windows Services from the command line? This Tech-Recipes tutorial describes how to perform these functions in all versions of Windows including XP and Windows 7.
First, we will need to open a command prompt terminal.
Go to the Start menu, and open a Command Prompt. With early versions of Windows, go to RUN, type CMD, and click on Enter. With later versions, just search for Command Prompt in the Start menu.
Here are the common methods of controlling the services through a command line. You can run these solo, scripted, or placed in batch files. The typical pattern is “net command servicename” where “command” is the actual command and “servicename” is the actual service you are manipulating.
Here are common examples, using the Telnet service as an example.
Net Start servicename to Start a Service
net start telnet
Net Stop servicename to Stop a Service
net stop telnet
Net Pause servicename to Pause a Service
net pause telnet
Net Continue servicename to Continue a Service
net continue telnet
In later versions of Windows, people frequently encounter the following error:
System error 5 has occurred.
Access is denied.
This error typically occurs when the user does not have administrative access. Try the command again after completing the following steps: right-click on Command Prompt, select Run as administrator, and confirm when the UAC prompt appears.