Create instance

  • techhunt

    techhunt - 2012-01-23

    WMIC provides CREATE verb which allows us to create a new instance.

            Creates a new instance and sets the property values. CREATE cannot be used to create a new class.

    I have to create a win32 class instance and assign properties to it. How is it possible with J-Interop?

    results = wbemServices_dispatch.callMethodA("InstancesOf", new Object{new JIString("Win32_Process"), new Integer(0), JIVariant.OPTIONAL_PARAM()});

    Does "Create"  will create an instance of Win32_process class and how to set properties for instantiated object.

  • Vikram Roopchand

         Please have a look at (in the "test" package) from the j-interop source code (SVN from

    best regards,

  • techhunt

    techhunt - 2012-01-24

    Thanks for response vikram.

    I followed your code. It shows how to get instances of a class but i want to know how to create an instance.

    for example i can create an instance of win32_environment class and set values to its properties using wmic tool

    wmic path Win32_environment CREATE NAME="ABC", VARIABLEVALUE="C:/Java/", username="<SYSTEM>"

    How can i achieve this using j-interop?

    does callMethodA has support to create instance?


  • techhunt

    techhunt - 2012-01-25

    To simplify my question, what are the possible strings to specify in  callMethodA to create and delete instances.

    Any help to resolve this is greatly appreciated.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks