Search code examples
gowindows-servicesoperating-system

List of services in OS - golang


How can I get the list of currently installed services in golang under Windows?

I need something like:

List of currently running process in golang

but for services and not process.


Solution

  • There is no such function in the standard library and there will likely never be.

    Consider using one of the functions in os/exec to launch a Windows program that will list the available services and parse its output (e.g. "sc query state=all").