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?
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
You could call the script from PB and use the output. Or you could create the script file from within PB, use it, then delete it. This is how I would do that: