Services in the Windows operating system are crucial background processes that enable various functions and applications to run smoothly. Services can be started, stopped, and managed through various command line tools. This tutorial provides 2 methods how to start and stop service on Windows.
Method 1 - CMD
The sc query command can be used to get current service status. For example, to check status of Apache service, run:
sc query Apache
You can utilize the net command in Command Prompt (CMD) to start or stop service. Ensure you run Command Prompt as an administrator before performing these actions. When starting a service, employ the net start command, followed by the name of the service:
net start Apache
To stop service, use the net stop command as follows:
net stop Apache
Method 2 - PowerShell
In PowerShell, current service status can be retrieved by using Get-Service command. For instance, to inspect the status of the Apache service, run:
Get-Service Apache
You can employ the PowerShell Start-Service or Stop-Service to start or stop a service. Ensure you open PowerShell as an administrator before proceeding. To start service, run the command:
Start-Service Apache
To stop service, run the command:
Stop-Service Apache
Leave a Comment
Cancel reply