Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to enumerate services
#2
Strange, fails on Windows 10 only, and I cannot find the reason.
This COM component is very old. Now better use .NET class ServiceController.

Macro Scripting C#, services
Code:
Copy      Help
CsScript x
x.AddCode("")

x.Call("Class1.Test")


#ret
using System;
using System.ServiceProcess;

public class Class1
{
public static void Test()
{
foreach (var se in ServiceController.GetServices())
{
Console.WriteLine(se.DisplayName);
//se.ServiceName
//se.Status
}
}
}


Messages In This Thread
Unable to enumerate services - by win - 11-15-2018, 02:35 AM
RE: Unable to enumerate services - by Gintaras - 11-15-2018, 07:34 AM
RE: Unable to enumerate services - by win - 11-15-2018, 09:31 AM
RE: Unable to enumerate services - by Gintaras - 11-15-2018, 09:49 AM
RE: Unable to enumerate services - by Gintaras - 11-15-2018, 11:54 AM
RE: Unable to enumerate services - by win - 11-15-2018, 02:50 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)