Windows services are a special apps which run in the background. Most of them have no interaction with the user session and have no user interface. Services are one of most important parts of the Windows NT operating system family, which was started with Windows NT 3.1 and includes all modern Windows versions like Windows 7, Windows 8 and Windows 10. Today, we will see how to save the list of running and stopped services to a text file.
Saving the list of services to a file is not a problem when you are using some third-party process manager. For example, the well-known process manager from Sysinternals, Process Explorer, allows exporting the list of running apps.
Out of the box, Windows 10 offers a few tools to manage services. The only GUI tool isa special MMC snap-in called "Services". Press Win + R shortcut keys on the keyboard to open the Run dialog. Type services.msc in the Run box.
The Services console looks as follows.
However, it doesn't allow saving the list of services to a file.
To bypass this limitation, we can use a special console tool, "sc". It is a powerful app which will allow you to manage existing services in Windows 10.
Save running services to a file
To save running services to a file in Windows 10, do the following.
- Open a new command prompt as Administrator.
- Type the following command to save the list of running services to a file:
sc query type= service > "%userprofile%\Desktop\active_services.txt"
Change the file name and its path according to your preferences.
- By following the example above, you will get a text file named "active_services.txt" in the Desktop folder. It will contain the list of your currently running services. Open it with a text editor app, e.g. Notepad.
You are done.
Tip: Run sc.exe with the option /? (sc /?
) to see the available options. Alternatively, see this online document.
Alternatively, you can use PowerShell. It comes with a special cmdlet Get-Service
.
Save Running Services to a File with PowerShell
- Open PowerShell. If required, run it as Administrator.
- Type the command
Get-Service | Where-Object {$_.Status -eq "Running"}
to see the list of the running services. - To save it to a file, run the command:
Get-Service | Where-Object {$_.Status -eq "Running"} | Out-File -filepath "$Env:userprofile\Desktop\active_services.txt"
- This will create a new text file "active_services.txt" in your Desktop folder.
Save Stopped Services to a File
- In an elevated command prompt, run the following command:
sc query type= service state= inactive > "%userprofile%\Desktop\inactive_services.txt"
. - Alternatively, open an elevated PowerShell and execute the following command sequence.
Get-Service | Where-Object {$_.Status -eq "Stopped"} | Out-File -filepath "$Env:userprofile\Desktop\inactive_services.txt"
. - Regardless of the method you use, you will get a new file, inactive_services.txt, in your Desktop folder. Open it with Notepad.
Save The List of All Windows Services to a File
- In an elevated command prompt, run the following command:
sc query type= service state= all > "%userprofile%\Desktop\all_services.txt"
. - Alternatively, open an elevated PowerShell and execute the following command sequence.
Get-Service | Out-File -filepath "$Env:userprofile\Desktop\all_services.txt"
. - Regardless of the method you use, you will get a new file, all_services.txt, in your Desktop folder. Open it with Notepad.
That's it.
Related articles:
- Save Running Processes To a File in Windows 10
- How To Start, Stop or Restart a Service in Windows 10
- How to Disable A Service in Windows 10
- How To Delete A Service in Windows 10
Support us
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options: