VB Scripting with Radia Objects


Part 1:

Radia objects can be manipulated using Vbscripts. Here I share an Example script for you. Hope this script can give you a basic idea about how you can use vbscript to control Radia Objects.

 Example 1:

 Read an EDM file :

 ‘ Read from an EDM file.

‘Syntax to given: GetRadiaObjectValue (Syntax EDM file,heap,variable)

 On error resume next

MsgBox “LASTRUN = ” & GetRadiaObjectValue(“LOCALCFG”,0,”LASTRUN”)

 Function GetRadiaObjectValue(str_Object,str_Heap,str_Property)

 Set process = GetObject(“winmgmts://./root/novadigm:NVD_Agent”)

 Set method = process.Methods_ (“GetValue”)

 Set inParameters = method.inParameters.SpawnInstance_()

 inParameters.Path = str_Object

 inParameters.Index = str_heap

 inParameters.Property = str_Property

 Set outParameters = process.ExecMethod_ (“GetValue”, inParameters)

 GetObjectValue = outParameters.Value

End Function

Advertisements

3 Responses to “VB Scripting with Radia Objects”


  1. 1 Jon January 19, 2011 at 5:21 pm

    Hello, Thank you for these examples, I am currently using HP CAE v7.9 and I tried your example but got a error while running it.

    I got an error on this line: Set outParameters = process.ExecMethod_ (“GetValue”, inParameters)

    Error in the DLL
    Source: SWbemObjectEX

    I have the client installed properly, I can see the Novadigm:NVD_Agent wmi namespace in a wmi browser. Howerver I get the above error. I have tried this from a few different PCs as well.

    I can’t remember what DLL that the WMI goes after, but I have tried to run a regsvr32 on the nvdagent.dll. However this was not able to register.

    Any clue what this would mean?

    • 2 Balsaraj January 20, 2011 at 3:44 am

      This script was tested only on windows XP .
      I may recommed to use “Dependecy walker ” utility to check the issue with dll registration (to identify related Dlls.)

  2. 3 F February 12, 2013 at 3:46 am

    Thanks for this code snippets. It made our automation project easier. 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: