Manage Windows Services Using Command Prompt

This post covers how to manage Windows services via the Command Prompt using built-in tools like sc, net, and tasklist.

Manage Windows Services Using Command Prompt

Getting Started

Windows Services are background processes that typically start automatically with Windows and run without user interaction. While the Services graphical interface (services.msc) is a common way to manage them, power users and administrators often prefer using the Windows Command Prompt for speed, scripting, or remote management.

Open Command Prompt

Before managing services, ensure you're running the Windows Command Prompt with administrative privileges,To open Command Prompt in Administrator Mode, follow the steps for your version of Windows

Using Start Menu
  1. Press Windows key or click on Start.
  2. Type: cmd or Command Prompt.
  3. When it shows up in the results, right-click it.
  4. Choose "Run as administrator".
  5. If prompted by User Account Control (UAC), click Yes.

Using Run Dialog
  1. Press Windows + R to open the Rundialog.
  2. Type:cmd
  3. Press Ctrl + Shift + Enter to open it as administrator.

Using Task Manager
  1. Press Ctrl + Shift + Esc to open Task Manager.
  2. Click File > Run new task.
  3. Type:cmd
  4. Check the box "Create this task with administrative privileges".
  5. Click OK.

CMD Commands To Manage Windows Service

Managing Windows services through the Command Prompt is a powerful way to control background processes, here are the Windows command prompt commands list for managing services.

View All Services
sc query type= service state= all

View Running Services
Using net command
net start

Using tasklist command
tasklist /svc

Check Specific Services
sc query "ServiceName"

Replace "ServiceName" with the actual name of the service (not the display name). For example, spooler for the Print Spooler service.

Find a Service using Display Name
sc getkeyname "Display Name"

Example:
sc getkeyname "Windows Update"

Create or Install a Service
Creating or installing a Windows service can be a bit of a lengthy process. I’ve already written two blog posts that explain the steps in detail. You can find the links below.

Start a Service
Using SC Command
sc start "ServiceName" 

Using NET Command
net start "ServiceName" 

Stop a Service
Using SC Command
sc stop "ServiceName" 

Using NET Command
net stop "ServiceName" 

Note:-Some services may depend on others. You may need to stop dependent services first.

Restart a Service
Using SC Command
sc start "ServiceName"  &&  sc stop "ServiceName" 

Using NET Command
net start "ServiceName" &&  net stop "ServiceName" 

There's no built-in CMD Commands to restart a service, but you can combine stop and start command to restart a service.

Change Service Startup Type

Use sc command, config to change how a service starts

Automatic:
sc config "ServiceName" start= auto

Manual:
sc config "ServiceName" start= demand

Disabled:
sc config "ServiceName" start= disabled

Note:-: There must be a space after the = symbol in the sc config command.

Delete a Service
sc delete "ServiceName" 

Summary

Managing Windows services through the Command Prompt is a powerful way to control background processes, automate system tasks, or troubleshoot issues without relying on the GUI. It's especially useful for remote administration and scripting.

Thanks

Kailash Chandra Behera

An IT professional with over 13 years of experience in the full software development life cycle for Windows, services, and web-based applications using Microsoft .NET technologies. Demonstrated expertise in delivering all phases of project development—from initiation to closure—while aligning with business objectives to drive process improvements, competitive advantage, and measurable bottom-line gains. Proven ability to work independently and manage multiple projects successfully. Committed to the efficient and effective development of projects in fast-paced, deadline-driven environments. Skills: Proficient in designing and developing applications using various Microsoft technologies. Total IT Experience: 13+ years

Previous Post Next Post

نموذج الاتصال