Over a million developers have joined DZone.

Installed Windows Services in C#

DZone's Guide to

Installed Windows Services in C#

Free Resource

The following code checks whether a Windows service is installed on your machine or not:

public static void ISWindowsServiceInstalled(string serviceName)
    // get list of Windows services
    ServiceController[] services = ServiceController.GetServices();
    foreach (ServiceController service in services)
        if (service.ServiceName == serviceName)
            return true;
    return false;



Published at DZone with permission of Amir Ahani, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}