How do I extract a list of Windows services and their status to a text file?

I would like to get a text dump of the screen you see when running services.msc (except the Description column). This is so I can run a diff after installing different software that adds services to this screen.

Is this possible?

If it's helpful I have access to Powershell but don't know how to retrieve this type of information from it.


Solution 1:

In the Services window, Action > Export... menu can give you the list as a .txt or .csv file. It gives you the description column as well, but you can easily delete it using a program like Excel.

You can also do this from Powershell.

Get-Service | Export-Csv -path "C:\services.csv"

Besides, you can filter the list. For example, you can get only the started services by executing the following command:

Get-Service | where {$_.Status -eq "Running"} | Export-Csv -path "C:\services.csv"

Solution 2:

Without using powershell, this lists running services:

 sc query > running_services.txt

This lists all services, running or not:

 sc query state= all > all_services.txt

Solution 3:

You can also use net start to get the list of the running services.