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

Heres How to Delete the Recovery Partition and the 450 MB Recovery Partition on Windows 10

Heres How to Delete the Recovery Partition and the 450 MB Recovery Partition on Windows 10

The Recovery partition is a separate partition on your computer's hard drive or SSD and is used to restore or reinstall the operating system in case of system failure.

How to hide icons on Windows 11 desktop?

How to hide icons on Windows 11 desktop?

There are many ways to hide all the icons on the Windows desktop to get a clean, distraction-free interface. Here is a guide to hide icons on the Windows 11 desktop.

How to turn off password sharing security in Windows 11

How to turn off password sharing security in Windows 11

Microsoft enables password-protected sharing. If you find this setting unnecessary, you can disable password-protected sharing in Windows 11.

How to change default language shortcuts Windows 11

How to change default language shortcuts Windows 11

The default language change shortcut is Windows + Space which cannot be turned off by default, but you can also change the language shortcut according to the article below.

How to turn off automatic app updates in Microsoft Store

How to turn off automatic app updates in Microsoft Store

The Store has removed the persistent toggle and now only lets you pause app updates for 1–5 weeks. If you want to block forced app updates, you can try some of the settings below.

Instructions for reinstalling Windows Settings

Instructions for reinstalling Windows Settings

In case the settings you have changed affect the content on your computer, or there is a problem, you can reset Windows Settings, following the instructions below.

How to close all open applications at once on Windows 11?

How to close all open applications at once on Windows 11?

Windows 11 doesn't have a specific close all apps button but there are some methods to close all open apps at once on Windows 11.

Instructions to fix the error “not recognized as an internal or external command” when using CMD in Windows

Instructions to fix the error “not recognized as an internal or external command” when using CMD in Windows

One day, you turn on your computer, go to CMD and get the error is not recognized as an internal or external command, operable program or batch file. What should you do?

Fix Copy Paste command not working on Word, Excel (2007, 2010)

Fix Copy Paste command not working on Word, Excel (2007, 2010)

There are many reasons why the Copy Paste command does not work on a Windows computer, such as your computer is attacked by a virus, the clipboard does not work, and therefore the copy command (Ctrl + C) and the paste command (Ctrl + V) do not work. So how to fix this error, please refer to the article below of WebTech360.

Fix function keys not working in Windows 10

Fix function keys not working in Windows 10

The Fn function keys give you a quicker and easier way to control some hardware features.

How to remove yellow triangle warning on Windows C drive

How to remove yellow triangle warning on Windows C drive

This out-of-place indicator usually means that BitLocker encryption has been disabled, an update requires a reboot, or a firmware upgrade is pending.

Instructions to change Google DNS 8.8.8.8 and 8.8.4.4

Instructions to change Google DNS 8.8.8.8 and 8.8.4.4

Google DNS 8.8.8.8 8.8.4.4 is one of the DNS chosen by many users, especially to increase network access speed or access blocked Facebook.

How to use TickTick desktop widget instead of to-do apps

How to use TickTick desktop widget instead of to-do apps

Once you put your to-do lists on Windows 11's widget panel, they start appearing in front of you every morning—and suddenly, it's not so easy to ignore them anymore.

How to Open Windows Security in Windows 10

How to Open Windows Security in Windows 10

Windows Security is turned on and proactively protects your device by scanning for malware, viruses, and other security threats.

How to Free Up 48GB on Windows 11 PC Without Losing Any Important Data

How to Free Up 48GB on Windows 11 PC Without Losing Any Important Data

Between temporary files, outdated backups, duplicate data, and unused apps, there are plenty of ways to reclaim space without touching your personal files.