Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8650943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:56:32+00:00 2026-06-12T13:56:32+00:00

I am currently working on a java-base cross-platform software distributor and I chose to

  • 0

I am currently working on a java-base cross-platform software distributor and I chose to use native OS mechanisms to prevent the users from having to do any setup before hand.

I chose JSCH for SSH2 and JACOB for Java. I realize that JACOB limits me to Windows as the starting host, but that is something I can live with.

I am writing a wrapper around JACOB to use some of the native mechanisms for talking to the target via WMI and I am running into a little issue. I am trying to retrieve a list of ALL the properties available for a given Win32_ class object and I haven’t been able to do it.

This link shows you can do it in VB http://www.vbsedit.com/scripts/misc/wmi/scr_1333.asp and I was wondering if anyone had been able to figure it out when using JACOB.

EDIT : (code snippet)

item = enumVariant.nextElement().toDispatch();
            //Dispatch.class returns a variant which can convert to java form
            String serviceName = Dispatch.call(item, "Name").toString();
            String servicePath = Dispatch.call(item,"PathName").toString();
            int servicePID = Dispatch.call(item,"ProcessId").getInt();
            //System.out.println("Service: "+serviceName+" ServicePath: "+servicePath+" PID: "+servicePID);
            //System.out.println(serviceName+" "+servicePath+" "+servicePID);
            list.add(serviceName+" "+servicePID);

Code above shows that I can ask for individual properties but there isn’t a good way to ask for ALL properties.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:56:33+00:00Added an answer on June 12, 2026 at 1:56 pm

    Here is the answer for your question. I hope so, because I don’t know where exactly your problem lies. I still think that when asking you should provide the part of code instead of requiring the answerer to write everything.

    This may be also an answer to a more general problem, that I just learnt:
    How to enumerate all items in a collection, implementing For Each construct?
    One should use EnumVariant Jacob class.

    import com.jacob.activeX.*;
    import com.jacob.com.*;
    
    public class testJacob {
      public static void main(String args[]) {
        String sMoniker = "winmgmts:{impersonationLevel=impersonate}!" +
          "\\\\.\\root\\cimv2";
        Dispatch dServ = new Dispatch(sMoniker);
        Variant v = Dispatch.call(dServ, "SubclassesOf");
        // SWbemObjectSet object
        // http://msdn.microsoft.com/en-us/library/aa393762%28v=vs.85%29.aspx
        Dispatch objSet = v.getDispatch();
        System.out.println("object count: " + objSet.get(objSet, "count"));
        int cObj = 0;
        EnumVariant en = new EnumVariant(objSet);
        while (en.hasMoreElements()) {
          // SWbemObject object
          // http://msdn.microsoft.com/en-us/library/aa393741(v=vs.85).aspx
          Dispatch dItem = en.nextElement().getDispatch();
          Dispatch dPath = Dispatch.get(dItem, "Path_").getDispatch();
          String sClass = Dispatch.get(dPath, "Class").getString();
          System.out.println("path: " + sClass);
          Dispatch dObj = Dispatch.call(dServ, "get", sClass).getDispatch();
          Dispatch dProps = Dispatch.call(dObj, "Properties_").getDispatch();
          EnumVariant enProp = new EnumVariant(dProps);
          while (enProp.hasMoreElements()) {
            Dispatch dProp = enProp.nextElement().getDispatch();
            String sProp = Dispatch.get(dProp, "name").getString();
            System.out.println("property: " + sProp);
          }
          if (++cObj >= 5)
            break;
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on building a java web app. I've been looking to use
I am currently working Java project with use of apache poi. Now in my
I'm currently working on a Java application which should have the capability to use
I've been working on a java web project. Currently this project doesnt use any
I am currently working with JNI (Java Native Interface) to send data between Java
I'm currently working on a project in Java, that will allow users to type
I am currently working on desktop software based on java.It's quite a big code
I am learning java from Java : Complete Reference. I am currently working on
We are currently working on a Java project with neo4j. We use Spring Data
I am currently working on 100+ Java Objects created by someone with no JPA/Hibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.