Article

Manage Services from Command Prompt/PowerShell in Windows

AOAnonymous One· Jan 13, 20231 min read
  • #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

  1. Press the Windows key on your keyboard, or click the Windows logo in the taskbar
  2. Type in “PowerShell”
  3. Right-click "Windows PowerShell”
  4. Select “Run as administrator”

The following tasks below are to be run in PowerShell as an administrator.

Find Service

Get-Service | Format-Table -Auto

Restart 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

  1. Press the Windows key on your keyboard, or click the Windows logo in the taskbar
  2. Type in “cmd”
  3. Right-click “Command Prompt”
  4. 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=service

Restart 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.

Search

Jump to a page, story or project