A nice example is there to use WMI in Powerbuilder that terminates a running process.
The same technique can be used to get SerialNumber of BaseBoard. I need to extend the same code to handle return values of the WQL query.
The WQL query i want to execute is:
SELECT Product, SerialNumber FROM Win32_BaseBoard
I can execute the query above but dont know how to save the SerialNumber in a variable after the ExecuteStatement() function is called.
Please take a look at the link for complete PowerBuilder code. How to terminate a process if it has specific folder name in its path?
Following is a portion of a sample code taken from the link above to show the function.
wsh = CREATE OleObject
wsh.ConnectToNewObject("MSScriptControl.ScriptControl")
wsh.Language = "VBScript"
wsh.AddCode(TheCode)
TRY
wsh.ExecuteStatement(FunctionName)
CATCH (RunTimeError Re01)
MessageBox("Query Error", "Following code has some problems.~r~n~r~n" + TheCode, StopSign!)
END TRY
wsh.DisconnectObject()
DESTROY wsh
The important function call wsh.ExecuteStatement(FunctionName)
What to do after that function call to set my PowerBuilder local variables with the returned SerialNumber of BaseBoard?