How to Export List of Running and Stopped Services in Windows


A service is an application type that runs in the system background without a user interface and is similar to a UNIX daemon process. Services provide core operating system features, such as Web serving, event logging, file serving, printing, cryptography, and error reporting.

This tutorial will show you how to export a list of running and stopped services to a file in Windows 7, Windows 8, and Windows 10.


 CONTENTS:

  • Option One: Export List of Running and Stopped Services in Command Prompt
  • Option Two: Export List of Running and Stopped Services in PowerShell





Export List of Running and Stopped Services in Windows OPTION ONE Export List of Running and Stopped Services in Windows
Export List of Running and Stopped Services in Command Prompt


For more Sc query command usage options, see: Sc query | Microsoft Docs

1. Open a command prompt.

2. Copy and paste the command you want to use below into the command prompt, and press Enter.


(For all running and stopped services)
sc query type= service state= all > "%UserProfile%\Desktop\All_Services.txt"

OR

(For all running services)
sc query type= service > "%UserProfile%\Desktop\Running_Services.txt"

OR

(For all stopped services)
sc query type= service state= inactive > "%UserProfile%\Desktop\Stopped_Services.txt"

3. You will now have a text file on your desktop with the list of all currently running and/or stopped services.






Export List of Running and Stopped Services in Windows OPTION TWO Export List of Running and Stopped Services in Windows
Export List of Running and Stopped Services in PowerShell


For more Get-Service command usage options, see: Get-Service | Microsoft Docs

1. Open Windows PowerShell.

2. Copy and paste the command you want to use below into PowerShell, and press Enter.


(For all running and stopped services to .txt file)
Get-Service | Format-Table -AutoSize | Out-File -filepath "$Env:userprofile\Desktop\All_Services.txt"

(For all running and stopped services to .csv file)
Get-Service | Export-Csv -path "$Env:userprofile\Desktop\All_Services.csv"

OR

(For all running services to .txt file)
Get-Service | Where-Object {$_.Status -eq "Running"} | Format-Table -AutoSize | Out-File -filepath "$Env:userprofile\Desktop\Running_Services.txt"

(For all running services to .csv file)
Get-Service | Where-Object {$_.Status -eq "Running"} | Export-Csv -path "$Env:userprofile\Desktop\Running_Services.csv"

OR

(For all stopped services to .txt file)
Get-Service | Where-Object {$_.Status -eq "Stopped"} | Format-Table -AutoSize | Out-File -filepath "$Env:userprofile\Desktop\Stopped_Services.txt"

(For all stopped services to .csv file)
Get-Service | Where-Object {$_.Status -eq "Stopped"} | Export-Csv -path "$Env:userprofile\Desktop\Stopped_Services.csv"

3. You will now have a .txt or .csv file on your desktop with the list of all currently running and/or stopped services.


That's it,
Shawn