Manage Services from Command Prompt/PowerShell in Windows
- #Windows
- #PowerShell
- #Command Prompt
- #Services
Manage Services from Command Prompt/PowerShell in Windows
Find, start, stop, and restart services in windows using Command Prompt/PowerShell.
I needed a way to restart a specific service quickly and it seemed frequent so I learned how to do it from the Command Prompt/PowerShell so I could create a script from it.
Open PowerShell as Administrator
- Press the Windows key on your keyboard, or click the Windows logo in the taskbar
- Type in “PowerShell”
- Right-click "Windows PowerShell”
- Select “Run as administrator”
The following tasks below are to be run in PowerShell as an administrator.
Find Service
Get-Service | Format-Table -AutoRestart Service
Restart-Service -Force -Name "<service-name>"or
Restart-Service -Force -DisplayName "<service-display-name>"Start Service
Start-Service -Name "<service-name>"or
Start-Service -DisplayName "<service-display-name>"Stop Service
Stop-Service -Name "<service-name>"or
Stop-Service -DisplayName "<service-display-name>"Open Command Prompt as Administrator
- Press the Windows key on your keyboard, or click the Windows logo in the taskbar
- Type in “cmd”
- Right-click “Command Prompt”
- Select “Run as administrator”
The following tasks below are to be run in a Command Prompt as an administrator.
Find Service
sc queryex state=all type=serviceRestart Service
net stop "<service-name>" && net start "<service-name>"Start Service
net start "<service-name>"Stop Service
net stop "<service-name>"0 Comments
Sign in to join the conversation.