VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get the list of services installed and its properties using Win32_Service WMI Class

by Karthikeyan (187 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Unknown Difficulty
Originally Published: Wed 11th February 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get the list of services installed and its properties using Win32_Service WMI Class

Rate Get the list of services installed and its properties using Win32_Service WMI Class



'Generated using 'WMI Win32 Class Autoscript Generator' - Developed by Karthikeyan
'Homepage: http://www.geocities.com/marskarthik

On Error Resume Next
Computer = "."
Set OutFile = CreateObject("WScript.Shell")
Const ForAppending = 2
Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set TextFile = FileSystem.OpenTextFile ("c:\Win32_Service.txt", ForAppending, True)
TextFile.WriteLine "Script for Win32_Service Class by Karthikeyan"
TextFile.WriteLine 
Set WMIService = GetObject("winmgmts:\\" & Computer & "\root\cimv2")
Set Items = WMIService.ExecQuery("Select * from Win32_Service",,48)
For Each SubItems in Items
TextFile.WriteLine "********************************************************************"
    TextFile.WriteLine "AcceptPause: " & SubItems.AcceptPause
    TextFile.WriteLine "AcceptStop: " & SubItems.AcceptStop
    TextFile.WriteLine "Caption: " & SubItems.Caption
    TextFile.WriteLine "CheckPoint: " & SubItems.CheckPoint
    TextFile.WriteLine "CreationClassName: " & SubItems.CreationClassName
    TextFile.WriteLine "Description: " & SubItems.Description
    TextFile.WriteLine "DesktopInteract: " & SubItems.DesktopInteract
    TextFile.WriteLine "DisplayName: " & SubItems.DisplayName
    TextFile.WriteLine "ErrorControl: " & SubItems.ErrorControl
    TextFile.WriteLine "ExitCode: " & SubItems.ExitCode
    TextFile.WriteLine "InstallDate: " & SubItems.InstallDate
    TextFile.WriteLine "Name: " & SubItems.Name
    TextFile.WriteLine "PathName: " & SubItems.PathName
    TextFile.WriteLine "ProcessId: " & SubItems.ProcessId
    TextFile.WriteLine "ServiceSpecificExitCode: " & SubItems.ServiceSpecificExitCode
    TextFile.WriteLine "ServiceType: " & SubItems.ServiceType
    TextFile.WriteLine "Started: " & SubItems.Started
    TextFile.WriteLine "StartMode: " & SubItems.StartMode
    TextFile.WriteLine "StartName: " & SubItems.StartName
    TextFile.WriteLine "State: " & SubItems.State
    TextFile.WriteLine "Status: " & SubItems.Status
    TextFile.WriteLine "SystemCreationClassName: " & SubItems.SystemCreationClassName
    TextFile.WriteLine "SystemName: " & SubItems.SystemName
    TextFile.WriteLine "TagId: " & SubItems.TagId
    TextFile.WriteLine "WaitHint: " & SubItems.WaitHint
TextFile.WriteLine "********************************************************************"
Next
TextFile.Close
OutFile.Run "notepad.exe c:\Win32_Service.txt",1,True


Download this snippet    Add to My Saved Code

Get the list of services installed and its properties using Win32_Service WMI Class Comments

No comments have been posted about Get the list of services installed and its properties using Win32_Service WMI Class. Why not be the first to post a comment about Get the list of services installed and its properties using Win32_Service WMI Class.

Post your comment

Subject:
Message:
0/1000 characters