WMI and Purebasic
Posted: Tue Oct 05, 2004 3:48 am
Hi Newbie question is it possible to use Purebasic to access and use WMI (Windows Management Instrumentation)? I can develop vbscript files pretty easy to do this but wanted to know if purebasic is able to accomplish the same.
Example vbscript WMI code can you conver the following code to purebasic?
Thanks in advance for all the help
Example vbscript WMI code can you conver the following code to purebasic?
Code: Select all
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim propValue
Dim SWBemlocator
Dim UserName
Dim Password
Dim colItems
strComputer = "."
UserName = ""
Passord = ""
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = SWBemlocator.ConnectServer(strComputer,"\root\CIMV2",UserName,Password)
Set colItems = objWMIService.ExecQuery("Select * from Win32_StartupCommand",,48)
For Each objItem in colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "Command: " & objItem.Command
WScript.Echo "Description: " & objItem.Description
WScript.Echo "Location: " & objItem.Location
WScript.Echo "Name: " & objItem.Name
WScript.Echo "SettingID: " & objItem.SettingID
WScript.Echo "User: " & objItem.User
Next