A netizen asks a question:
SELECT * FROM Win32_Service this can check service name, status ...
But I would like to check the service manufacturers, such as Microsoft, Agricultural Bank, or unknown?? What this attribute is, thank you ...
I found what I could see in the Msconfig, but I couldn't extract it.
Here's an indirect approach to the answer:
Gets the associated main program based on the service name, and then gets the manufacturer from the main program
Set objWMIService = GetObject ("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2") Set Services = objWMIService.ExecQuery ("Select * FROM Win32_Service") Set fso = CreateObject ("Scripting.FileSystemObject") set Objshell = CreateObject ("Shell.Application") Set objfolder = objshell.namespace (0) i = 0 do If objfolder.getdetailsof ("" , i) = "Company" Then ' non-Chinese system modifies Exit do Else i = I+1 end If loop for each objservice in Services path = GetPath (objservice.pathname) IF fso. Getextensionname (path) = "" Then Path = path & ". exe" Set objfolder = Objshell.namespace (fso. Getparentfoldername (path)) Set objitem = Objfolder.parsename (fso. GetFileName (path)) comp = objfolder.getdetailsof (objitem, i) If comp = "" Then comp = "Unknown" info = info & "Services:" &A mp Objservice.displayname & "Manufacturer:" & comp & VbCrLF Next fso. CreateTextFile ("Info.txt", true). WriteLine info MsgBox "complete" Function GetPath (strng) Dim re Set re = New RegExp re. Pattern = "^" "? (. +\\[^\\\s""]+). * "GetPath = Re.
Replace (STRNG, "$") Set regEx = Nothing End Function
is not a very good solution, the small partners can learn.