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

Turn off these 7 Windows services to extend battery life!

Turn off these 7 Windows services to extend battery life!

Turning off a few of these services can save you a significant amount of battery life without affecting your daily usage.

9 Old Windows Tools That Are Still Useful Today

9 Old Windows Tools That Are Still Useful Today

From performance monitoring to quick system tweaking, these built-in utilities are as useful as ever.

How to fix error code 0x80004005

How to fix error code 0x80004005

Error code 0x80004005 is a type of unknown Windows error, whose cause is related to a number of different issues.

How to Show the Missing Bluetooth Icon on the Windows Taskbar

How to Show the Missing Bluetooth Icon on the Windows Taskbar

If you can't find the Bluetooth icon on the taskbar, follow the steps below to show the missing Bluetooth icon on Taskbar in Windows 10.

How to Clear NVIDIA Shader Cache on Windows

How to Clear NVIDIA Shader Cache on Windows

Clearing the NVIDIA Shader Cache will reset the system, forcing it to rebuild with new data. Here are instructions for clearing the NVIDIA Shader Cache.

Summary of some simple ways to disable USB ports on Windows computers

Summary of some simple ways to disable USB ports on Windows computers

Unlocking USB ports in BIOS is not difficult. However, how to lock computer USB ports? Let's find out with Quantrimang.com!

Extremely simple tips to change IP without VPN

Extremely simple tips to change IP without VPN

Being blocked online can be frustrating, whether it's a forum lockout, a game ban, or a temporary IP restriction. The good news is that you don't always need a VPN to get around these restrictions.

How to Take Advantage of the Performance Tab in Task Manager

How to Take Advantage of the Performance Tab in Task Manager

When your computer crashes, seeing how everything is running can help you troubleshoot. And when everything is working, this information can also help you optimize your system.

5 tips to help your Windows 11 laptop battery last all day

5 tips to help your Windows 11 laptop battery last all day

Windows laptops aren't known for their battery life, at least not without some tweaking. But these tips will help your laptop last all day without having to find a power outlet.

Enable or disable the built-in Administrator account on Windows

Enable or disable the built-in Administrator account on Windows

Windows 10/11 includes a hidden Administrator account that you can use to manage all the important data on your computer. Let's see how to enable or disable the built-in Administrator account on Windows 10/11!

Instructions to fix System Service Exception error on Windows

Instructions to fix System Service Exception error on Windows

System Service Exception or SYSTEM_SERVICE_EXCEPTION is one of the BSOD errors (blue screen of death errors). System Service Exceptions errors occur quite commonly and continuously.

Recover Deleted Data with Recuva Portable in Windows 7

Recover Deleted Data with Recuva Portable in Windows 7

In the following article, we will present the basic operations to recover deleted data in Windows 7 with the support tool Recuva Portable. With Recuva Portable, you can store it in any convenient USB, and use it whenever needed. The tool is compact, simple, easy to use with some of the following features:

How to delete duplicate files to save computer memory using CCleaner

How to delete duplicate files to save computer memory using CCleaner

CCleaner scans for duplicate files in just a few minutes, then lets you decide which ones are safe to delete.

10 Windows Settings You Should Never Leave as Default

10 Windows Settings You Should Never Leave as Default

Windows doesn't come with security set up by default, which means there are some default settings you need to change.

How to Download, Update, and Troubleshoot USB Drivers on Windows 10

How to Download, Update, and Troubleshoot USB Drivers on Windows 10

USB devices have become indispensable in everyday life, allowing us to connect a wide variety of essential hardware to our PCs.