Imports System
Imports System.Management
Module Module1
Public Sub Main()
Dim strComputer = "ComputerName"
Dim wbemServices, wbemObjectSet, wbemObject
wbemServices = GetObject("winmgmts:\\" & strComputer)
wbemObjectSet = wbemServices.InstancesOf("Win32_Service")
For Each wbemObject In wbemObjectSet
Console.WriteLine("服务名称:" & wbemObject.DisplayName)
Console.WriteLine("当前状态:" & wbemObject.State)
Console.WriteLine("启动模式:" & wbemObject.StartMode)
Next
End Sub
End Module
没有评论:
发表评论