Get List of Installed Windows Services using C#


Below is a program that will return all installed Windows Services on a local machine. The program uses the namespace System.ServiceProcess, which can be used by adding the Assemblies System.ServiceProcess.dll

 static void Main(string[] args)
        {

            System.ServiceProcess.ServiceController[] services = System.ServiceProcess.ServiceController.GetServices();

            foreach (System.ServiceProcess.ServiceController service in services)
            {
                Console.WriteLine(service.ServiceName);
            }
            Console.ReadKey();
        }

Happy Coding!

More C# Snippets

Asha Shoukeir

About Asha shoukeir

Software Developer and System Administrator

View all posts by Asha shoukeir →

Leave a Reply