How to manage Windows services via command line

People are always looking for efficient ways to manage system tasks without leaving the terminal, even when using Windows. On Windows, services run in the background to keep the system and applications running smoothly. Instead of opening the Services Manager, many people prefer to manage Windows services through the command line. In today’s tutorial, we will explore these methods and see how you can manage Windows services right from the terminal.

1. Manage Windows service using sc.exe

sc.exe is a built-in command-line tool for managing Windows services. It allows you to configure, query, and control services directly from the terminal. With sc.exe, you can have complete control over Windows services without the need for the graphical Services Manager.

Check service status with sc

We can use the sc query serviceName command to check the status of a specific service. For example, we run the sc query MySQL80 command to retrieve detailed information about the MySQL80 service, including its status:

How to manage Windows services via command line
Check service status with sc

MySQL is not running on the machine at the moment.

Start a service with sc

To start a specific service using sc.exe, we can use the sc start ServiceName command . For example, we run sc start MySQL80 to start the MySQL80 service. To verify whether the service has started successfully, we can check the status of the service using the sc query MySQL80 command :

How to manage Windows services via command line

Stop a service with sc

You can stop a service to free up system resources. For example, the sc stop MySQL80 command stops MySQL, which can be verified with the sc query MySQL80 command :

How to manage Windows services via command line

Create a new service using sc

We can create a new service using the sc create command . This command requires specifying the service name, executable path, and startup type. For example, to create a new service called "mte" that will start automatically on boot, type:

sc create mte binPath= "C:\Users\HP\Desktop\Examples\Service.exe" start= auto
How to manage Windows services via command line

Update a service using sc

We can use the sc config command to configure an existing service. For example, to change the startup type to manual, run the command:

sc config serviceName start= demand
How to manage Windows services via command line

Delete service using sc

When the service is no longer needed, we can permanently remove it from Windows with the command:

sc delete srviceName
How to manage Windows services via command line

2. Manage Windows services using the Net command

The net command in Windows allows us to manage services from the command line. This command allows users to start, stop, pause, resume, and query services without using the graphical Services Manager.

Start and stop services using the net command

We can start or stop Windows services using the net start serviceName and net stop serviceName commands respectively:

How to manage Windows services via command line
Start or stop service with net command

Pause and resume service using net command

Some Windows services support pausing and continuing instead of stopping completely. In that case, we can use the net pause ServiceName and net continue ServiceName commands respectively:

How to manage Windows services via command line
Pause and resume net service

Check service status with net command

The net command itself does not provide a direct way to check the status of a specific service, but we can use it in conjunction with the findstr command to filter the results. For example, to check if a specified service is running, type:

net start | findstr "ServiceName"
How to manage Windows services via command line
Check service status with net command

If the specified service is running, the command returns the name of that service; otherwise, there is no output.

Manage remote services using the net command

We can use the net command to manage services on a remote computer by specifying the computer name. For example, the net start ServiceName /S RemotePC and net stop ServiceName /S RemotePC commands are used to start or stop services on a remote computer.

Sign up and earn $1000 a day ⋙

Leave a Comment

Fix Windows Error Code 0xc0000098: Backup ACPI.sys to Prevent Boot Failure

Fix Windows Error Code 0xc0000098: Backup ACPI.sys to Prevent Boot Failure

Error code 0xc0000098 in Windows causes a blue screen error on startup. The ACPI.sys driver is often to blame, especially on unsupported versions of Windows 11 like 23H2 or 22H2 or Windows 10.

Quickly fix Windows 10/8/7 computer error that freezes and cannot exit Safe Mode

Quickly fix Windows 10/8/7 computer error that freezes and cannot exit Safe Mode

In some cases, sometimes you start your computer in Safe Mode and the computer freezes. So how to fix the error in this case, please refer to the article below of WebTech360.

How to fix Snipping Tool keeps showing error

How to fix Snipping Tool keeps showing error

Snipping Tool is a powerful photo and video capture tool on Windows. However, this tool sometimes has some errors, such as constantly displaying on the screen.

How to get the fastest internet connection from your router

How to get the fastest internet connection from your router

Every network has a router to access the Internet, but not everyone knows how to make the router work better. In this article, we will introduce some router tips to help speed up the wireless connection in the network.

Common Mistakes When Performing Internet Speed ​​Tests

Common Mistakes When Performing Internet Speed ​​Tests

If the results seem slower than expected, don't be too quick to blame your ISP - mistakes when performing the test can skew your numbers.

What is QoS? How to use QoS for faster Internet speeds when you need it most

What is QoS? How to use QoS for faster Internet speeds when you need it most

In the article below, we will introduce and guide you to learn about the concept of QoS - Quality of Service on router devices.

Why cant this built-in Credential Manager feature in Windows replace a password manager?

Why cant this built-in Credential Manager feature in Windows replace a password manager?

Windows has a built-in Credential Manager, but it's not what you think it is—and certainly not a replacement for a password manager.

How to install free HEVC codecs on Windows 10 (for H.265 video)

How to install free HEVC codecs on Windows 10 (for H.265 video)

Microsoft charges for its official codecs and doesn't include them in Windows 10. However, you can get them for free without pulling out your credit card and spending $0.99.

Instructions to fix Access Denied error when accessing files or folders on Windows

Instructions to fix Access Denied error when accessing files or folders on Windows

While having trouble accessing files and folders can be frustrating, don't panic—with a few simple tweaks, you can regain access to your system.

How to check if USB Boot has been created successfully?

How to check if USB Boot has been created successfully?

After creating a USB boot to install Windows, users should check the USB boot's performance to see if it was created successfully or not.

4 Types of Windows Data That Are Growing in Size: How to Control Them?

4 Types of Windows Data That Are Growing in Size: How to Control Them?

Although Windows Storage Sense efficiently deletes temporary files, some types of data are permanent and continue to accumulate.

How to turn off background apps in Windows 11, reduce RAM consumption on Win 11

How to turn off background apps in Windows 11, reduce RAM consumption on Win 11

You can turn off Windows 11 background apps to optimize performance, save battery and reduce RAM consumption.

Instructions to fix the error “Network path was not found” in Windows

Instructions to fix the error “Network path was not found” in Windows

When a computer, mobile device, or printer tries to connect to a Microsoft Windows computer over a network, for example, the error message network path was not found — Error 0x80070035 may appear.

How to block Internet connection of Windows 10 software and applications

How to block Internet connection of Windows 10 software and applications

We can block Internet access for any application or software on the computer, while other programs can still access the network. The following article will guide readers on how to disable Internet access for software and applications on Windows.

How to Stay Safe on Windows 10 Until 2030

How to Stay Safe on Windows 10 Until 2030

Instead of paying $30 for a year of security updates, keep Windows 10 safe until 2030 with this simple solution.