注册表中有运行状态吗?
我只知道.net的            ServiceController sc = new ServiceController("Apache2");
            if (sc.Status != ServiceControllerStatus.Running)
            {
                sc.Start();//停止了就重启服务
            }
            sc.Close();