d

WMI List Windows Services and State

List Windows Services and their running State

//List Services and their states

var wmi      = GetObject("winMgmts:");
var services = new Enumerator( wmi.InstancesOf("Win32_Service") );

for (;!services.atEnd();services.moveNext())
{
    var service = services.item();
    var msg = "[";
    msg += ( service.Started ? "Running" : "Stopped" );
    msg += "] ";
    msg += service.Name; 
    WScript.Echo( msg );
}