Windows cmd list all services

The services in Windows can be listed using the Service Manager tool.

To start the Service Manager GUI, press ⊞ Win keybutton to open the “Start” menu, type in services to search for the Service Manager and press Enter to launch it.

The services can also be listed using the command-line prompt (CMD) or the PowerShell.

In this note i am showing how to list the services and how to search for a specific service in Windows using the command-line prompt (CMD) or the PowerShell.

Cool Tip: List processes in Windows from the CMD! Read more →

List Services Using Command Line (CMD)

List all services:

C:\> sc queryex type=service state=all

List service names only:

C:\> sc queryex type=service state=all | find /i "SERVICE_NAME:"

Search for specific service:

C:\> sc queryex type=service state=all | find /i "SERVICE_NAME: myService"

Get the status of a specific service:

C:\> sc query myService

Get a list of the running services:

C:\> sc queryex type=service
- or -
C:\> sc queryex type=service state=active
-or -
C:\> net start

Get a list of the stopped services:

C:\> sc queryex type=service state=inactive

Cool Tip: Start/Stop a service in Windows from the CMD & PowerShell! Read more →

List all services:

PS C:\> Get-Service

Search for specific service:

PS C:\> Get-Service | Where-Object {$_.Name -like "*myService*"}

Get the status of a specific service:

PS C:\> Get-Service myService

Get a list of the running services:

PS C:\> Get-Service | Where-Object {$_.Status -eq "Running"}

Get a list of the stopped services:

PS C:\> Get-Service | Where-Object {$_.Status -eq "Stopped"}

Was it useful? Share this post with the world!

How to block File Sharing for one or more IP Addresses in Windows

As you most likely already know, in Windows operating systems, a Windows service is a computer program that operates in the background, just like daemons in a Unix-like environment. They can be configured to either start when the operating system is started and run in the background as long as Windows is running, or started manually using the Service Manager tool, which can be launched by typing
services.msc  from the command prompt or by opening the start menu, typing «services» from the Start Menu and then launching the Service Manager icon that should show up right away.

In this post we’ll see some useful command-line prompt (CMD) and Powershell commands that can be used from most Windows environments (including Windows 10 and Windows Server) to list the installed / active / inactive services, as well as search for a specific service in Windows.

If you’re looking for a complete list of all the existing/available Windows Services, check out this post.

Command-Line (CMD) commands

How to list all Windows services:

sc queryex type=service state=all

How to list all Windows services (names only):

sc queryex type=service state=all | find /i «SERVICE_NAME:»

How to list all the running Windows services, excluding the stopped / inactive ones:

sc queryex type=service state=active

How to list all the stopped / inactive Windows services, excluding the running ones:

sc queryex type=service state=inactive

How to search for a given Windows service (by name):

sc queryex type=service state=all | find /i «SERVICE_NAME: MyServiceName»

How to retrieve the status of a given service (by name):

PowerShell commands

How to list all Windows services:

How to list all Windows services (names only):

sc queryex type=service state=all | find /i «SERVICE_NAME:»

How to list all the running Windows services, excluding the stopped / inactive ones:

Get-Service | WhereObject {$_.Status -eq «Running»}

How to list all the stopped / inactive Windows services, excluding the running ones:

Get-Service | WhereObject {$_.Status -eq «Stopped»}

How to search for a specific Windows service:

Get-Service | WhereObject {$_.Name -like «*MyServiceName*»}

How to retrieve the status of a given service (by name):

Get-Service MyServiceName*

Conclusions

We definitely hope that this post will help those system administrators that are looking for a quick and effective way to list, filter, search and/or retrieve the status of the Windows Services installed on their Windows machines using the command-line prompt (CMD) or Powershell.

The emphasis of this question is on the second half.

I know how to extract a list of all the services and how to filter on their state. However, what I am unsure how to do is to extract the user account the service is set to «run as».

I don’t have the option of using PowerShell (unfortunately) so I’m looking for a native CMD way. I assumed there would be a way to use the sc query command but all that lists is:

SERVICE_NAME
TYPE
STATE
WIN32_EXIT_CODE
SERVICE_EXIT_CODE
CHECKPOINT
WAIT_HINT

FYI — The OS is WIndows 2003 SP2 and I need this information for all of the services so is a long winded process if I have to do it manually for each of them.

asked Apr 17, 2015 at 14:56

Petay87's user avatar

wmic:
Name and account for all services:
wmic service get name,startname

started services only:
wmic service where started=true get name, startname

services with specific pattern in name:
wmic service where 'name like "%sql%"' get name, startname

nicely formatted as html table (and then opened in your browser):
(wmic service where 'name like "%sql%"' get name, startname /format:htable >out.html) && out.html

Full syntax here: https://msdn.microsoft.com/en-us/library/aa394531%28v=vs.85%29.aspx

answered Apr 17, 2015 at 15:54

wmz's user avatar

wmzwmz

7,1201 gold badge21 silver badges32 bronze badges

2

You can accomplish this in two steps:

  1. Get the list of services:sc \\localhost query | findstr SERVICE_NAME
  2. Your missing piece: sc \\localhost qc + SERVICE_NAME + | findstr SERVICE_START_NAME

I would recommend a batch script like this:

@echo off
setlocal EnableDelayedExpansion
sc \\localhost query | findstr SERVICE_NAME > services.lst
for /f "tokens=1,2" %%A in (services.lst) do (
    echo %%B
    sc \\localhost qc %%B | findstr SERVICE_START_NAME
)
del services.lst

That gives you an output like this:
enter image description here

Of course, you can further cleanup that output or write to a CSV file in any manner that you would like.

Community's user avatar

answered Apr 17, 2015 at 15:21

armani's user avatar

armaniarmani

5862 silver badges8 bronze badges

CMD has no native way to do it. SC and NET are built-in applications that come with Windows but that doesn’t mean they’re native. At any time an admin can remove them and then even CMD is left in the dark.

sc sdshow is what will get you security descriptors, but this will complicate things if you don’t know how to read SDDL strings.

Simplest way is to get Sysinternals PsService.exe from Tools package and use it as psservice security [service]. It will list the SDDL in readable format, including account names.

answered Apr 17, 2015 at 15:21

JasonXA's user avatar

JasonXAJasonXA

8657 silver badges16 bronze badges

2

Although you can’t use PowerShell you should still be able to use VBScript to pull the info from WMI:

Here’s a VBS script that will list all services and the account they start as:

strComputer = "."

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery ("Select * from Win32_Service")

For Each objService in colServices 
    wscript.echo objService.Name & ": " & objService.StartName
Next

Save it and then run it with cscript ScriptName.vbs.

objService.State would give you the service’s current state (since you mentioned you’re looking to filter by it).

More info on the Win32_Service class.

answered Apr 17, 2015 at 15:40

Ƭᴇcʜιᴇ007's user avatar

Ƭᴇcʜιᴇ007Ƭᴇcʜιᴇ007

112k19 gold badges201 silver badges268 bronze badges

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

The running applications you see on your screen are a fraction of what is happening in Windows. From managing device drivers to ensuring security, a bunch of background processes maintain a functioning Windows PC.

For any system administrator overseeing multiple computers, it is important to be able to view the status of these critical services. The Task Manager approach is too slow for this, and you cannot automate it with a script.

The solution? Command-line tools. Using the Command Prompt or PowerShell, you can quickly get a read on the operational Microsoft services running on a system, helping you diagnose any issues swiftly. 

Listing Windows Services In the Command Prompt

While not as flexible or powerful as Windows PowerShell, the Command Prompt is still an excellent tool for system administrators. You can use the queryex command to get the status of both active and disabled services and then use the taskkill command to end pesky processes.

  1. To use the queryex command, run Command Prompt as an Administrator. You can find the app by searching cmd in the start menu.

  1. There are many ways of using the sc queryex command. Type and State are the two most commonly used parameters. For example, enter the following command to view all  Windows processes:

sc queryex type=service state=all

  1. The default view can be a bit overwhelming. You can display just the names of processes to make the list easier to parse:

sc queryex type=service state=all | find /i “SERVICE_NAME:”

  1. By default, the command lists all active processes. To look for inactive ones, modify the state parameter:

sc queryex type=service state=inactive

  1. You can also query the status of a specific process by its name. This is incredibly useful for system administrators, as they can set up batch files to check many processes at once. Here’s an example:

sc query DeviceInstall

Listing Windows Services in PowerShell

PowerShell is meant to be a dedicated command-line shell for modern Windows. As such, it provides access to pretty much every operating system component through commands, and Windows services are no exception.

PowerShell’s advantage is that you can automate it easily. All PowerShell commands can be compiled into complex scripts, allowing you to set up system administration tasks on multiple PCs without hassle.

  1. Start by opening PowerShell. You can search for it in the Start Menu; just make sure to run an elevated instance (i.e., as an Administrator).
  1. The simplest command for listing Windows services on PowerShell is Get-Service. It shows all services on your computer, along with their status and names. The only problem is that the list of services can be pretty long.
  1. When using Get-Service, it is a better idea to export the list to a text file. You can do this using pipes, like this:

Get-Service | Out-File “C:\logs\All_Services.txt”

  1. To look up the status of a specific service, follow the Get-Service command with the name of the service. You can request the status of multiple processes by separating their names with commas.

Get-Service CryptSvc, COMSysApp

  1. Pipes can also be used to combine the Get-Service cmdlet with the Where-Object function and filter the results by Status. The following command illustrates this by getting all Running services:

Get-Service | Where-Object {$_.Status -EQ “Running”}

Checking Service Dependencies

Any complex process is split into multiple interdependent services. This is why simply getting the status of a particular service is often not enough. You also need to check the status of the services that service is dependent on.

  1. To view the services required by a particular service, use the -RequiredServices flag with the Get-Service cmdlet. Here’s an example:

Get-Service -Name CryptSvc –RequiredServices

  1. Similarly, to get a list of services that depend on a specific service, take advantage of the -DependentServices flag.

Get-Service -Name CryptSvc -DependentServices

These two flags are crucial in writing scripts to automatically start or stop Windows services, as they give you a way to keep track of all the services connected with the affected service.

Listing Windows Services On Remote Computers

The PowerShell method is not limited to local computers. You can use the Get-Service cmdlet with the same syntax described above to query the processes of remote PCs as well. Just append the -ComputerName flag at the end to specify which remote computer to retrieve information from. 

Here’s an example:

get-service CryptSvc -ComputerName Workstation7

Managing Windows Services in PowerShell

Getting the status of services isn’t the only thing you can do in Windows PowerShell. As a full-fledged scripting environment, it provides script alternatives to all GUI options. 

Powershell cmdlets can stop, start, restart, or even modify services. Paired with automated Get-Service commands, PowerShell scripts can be written to fully automate everyday system management tasks.

  1. In addition to querying the status of services, you can also use PowerShell to manage them. Starting or stopping services can be done with a single command, requiring only the name of the service. For example, this is how you can stop a service:

Stop-Service -Name Spooler

  1. Starting a service goes similarly:

Start-Service -Name Spooler

  1. If a service isn’t working correctly, you can also choose to restart it:

Restart-Service -Name Spooler

  1. There is also the Set-Service cmdlet that can be used to change the properties of a service. Here we disable the automatic startup of the Print Spooler service:

Set-Service ‘Spooler’ -StartupType Disabled

What Is the Best Way to List Windows Services?

Whether you are running Windows 10 or a Windows Server, being able to view a list of all Windows services can be handy. You can diagnose issues with critical system functions or stop unnecessary Microsoft services to improve performance.

For this purpose, PowerShell is the best option. While you can obtain a service list in Command Prompt, the additional functionality provided by PowerShell is more useful.

You can use PowerShell cmdlets to get the service status of Windows processes, filtering them by their status or other parameters. It is also easy to determine dependent services and start or stop them as required.

  1. How can I see services in CMD?
  2. How do I see all services in Windows?
  3. How do I check services?
  4. Which command displays a list of services?
  5. How do I list all services in Systemctl?
  6. How do I list all services in PowerShell?
  7. What command do you need to type to list all the running services?
  8. Where is services MSC located?
  9. What is SC query command?
  10. What is Systemctl command?
  11. What are Windows services?
  12. How do you display a list of currently running applications and services?
  13. How do you use Runas?
  14. How do I list services in Linux?
  15. How do I list all processes in Linux?
  16. How do I view systemd services?

How can I see services in CMD?

Open Start. Search for Command Prompt, right-click the top result, and select the Run as administrator option. (Optional) Type the following command to view a list of all the services and press Enter: sc queryex state=all type=service.

How do I see all services in Windows?

Windows has always used the Services panel as a way to manage the services that are running on your computer. You can easily get there at any point by simply hitting WIN + R on your keyboard to open the Run dialog, and typing in services. msc.

How do I check services?

Press the Win + R keys on your keyboard, to open the Run window. Then, type «services. msc» and hit Enter or press OK. The Services app window is now open.

Which command displays a list of services?

To list all the services which are currently running on a windows machine using the command prompt you can use the net start command.

How do I list all services in Systemctl?

You can list all enabled services, whether they are running or not using the following command. It will list services that run at startup. systemctl list-unit-files will list system file units.

How do I list all services in PowerShell?

Open an elevated PowerShell console, type Get-Service and hit Enter. You will see a list of all the Services installed on your Windows system.

What command do you need to type to list all the running services?

And from now onwards, use the “running_services” command to view a list of all loaded, actively running services on your server. Besides, an important aspect of services is the port they use.

Where is services MSC located?

It is located in the %SystemRoot%\System32\services.exe executable. Service processes interact with SCM through a well-defined API, and the same API is used internally by the interactive Windows service management tools such as the MMC snap-in Services. msc and the command-line Service Control utility sc.exe .

What is SC query command?

Top Windows command-line commands

Anytime you want to know what services are installed on a computer and find out which ones are active, you can use sc query state= all to find a complete list. If the computer in question is remote, you should use sc \\computername query state= all.

What is Systemctl command?

Systemctl is a Linux command-line utility used to control and manage systemd and services. You can think of Systemctl as a control interface for Systemd init service, allowing you to communicate with systemd and perform operations. Systemctl is a successor of Init.

What are Windows services?

Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface.

How do you display a list of currently running applications and services?

Windows programs run as one or more processes or tasks. You can use the TASKLIST command to display a list of currently-running tasks. TASKLIST displays the process ID number for each running task, the name of the executable program that started the task, and, when available, the window title.

How do you use Runas?

To use runas at the command line, open a command prompt, type runas with the appropriate parameters, and then press ENTER. In the user interface for Windows Vista, the Run as… command has been changed to Run as administrator.

How do I list services in Linux?

The easiest way to list services on Linux, when you are on a SystemV init system, is to use the “service” command followed by “–status-all” option. This way, you will be presented with a complete list of services on your system. As you can see, each service is listed preceded by symbols under brackets.

How do I list all processes in Linux?

To list currently running processes, use the ps , top , htop , and atop Linux commands. You can also combine the ps command with the pgrep command to identify individual processes.

How do I view systemd services?

To see an overview of the current state of a unit, you can use the status option with the systemctl command. This will show you whether the unit is active, information about the process, and the latest journal entries: systemctl status nginx. service.

  • Windows by den официальный сайт
  • Windows cmd if not exist
  • Windows chess game download windows 7
  • Windows cmd права на файл
  • Windows caps lock switch language