(view source code of services.kix as plain text)
; Check KiXtart version
$KixMajorVer = SubStr( @Kix, 1, InStr( @Kix, "." ) - 1 )
If $KixMajorVer < 4
Syntax()
EndIf
; Query and display running processes
$objWMIService = GetObject( "winmgmts://./root/cimv2" )
; Display error number and description if applicable
If $Err.Number
ShowErr()
EndIf
; Collect information on services
$colItems = $objWMIService.ExecQuery( "Select * from Win32_Service", , 48 )
; Display results
For Each $objItem in $colItems
? "Name: " + $objItem.Name
? "DisplayName: " + $objItem.DisplayName
? "PathName: " + $objItem.PathName
? "StartMode: " + $objItem.StartMode
? "State: " + $objItem.State
? "StartName: " + $objItem.StartName
?
Next
; Done
Quit 0
Function ShowErr
? "Error # " + $Err.Number
? $Err.Description
?
Syntax
EndFunction
Function Syntax
? "Services.kix, Version 1.00"
? "Display all services on local computer"
?
? "Usage: KIX32 SERVICES.KIX"
?
? "Written by Rob van der Woude"
? "http://www.robvanderwoude.com"
?
? "This script needs KiXtart version 4.* or later."
? "Your KiXtart version is @KIX."
?
Quit 1
EndFunction
page last modified: 2024-04-16; loaded in 0.0055 seconds