Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not run in windows 10 #5

Open
liuwenru opened this issue Mar 24, 2017 · 4 comments
Open

can not run in windows 10 #5

liuwenru opened this issue Mar 24, 2017 · 4 comments

Comments

@liuwenru
Copy link

when i use the jar file in windows 10.it not work......

the error follow

三月 24, 2017 8:45:18 上午 com.profesorfalken.wmi4java.WMI4Java listClasses
严重: Error calling WMI4Java
com.profesorfalken.wmi4java.WMIException: WMI operation finished in error: 
	at com.profesorfalken.wmi4java.WMIPowerShell.executeCommand(WMIPowerShell.java:45)
	at com.profesorfalken.wmi4java.WMIPowerShell.listClasses(WMIPowerShell.java:69)
	at com.profesorfalken.wmi4java.WMI4Java.listClasses(WMI4Java.java:170)
	at org.ijarvis.WMITest.main(WMITest.java:14)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

please tell me how to use it, thinks

@profesorfalken
Copy link
Owner

Hello,

The WMI command you are trying to execute is returning an error.
What is the command you are trying to execute?
Have you tested it in console before trying to execute with WMI4Java?

Best regards,

@liuwenru
Copy link
Author

only this method can not use ,if i run this method , it will report the error

List<String> wmiClassesList = WMI4Java.get().listClasses();

@profesorfalken
Copy link
Owner

Hello,

This is weird... do you have jPowerShell jar in your classpath?

If it is not the case, try to do instead:

List<String> wmiClassesList = WMI4Java.get().VBSEngine().listClasses();

Regards

@mongolia19
Copy link

Hi,
I tried your way out like this:

List<Map<String, String>> wmiObjectProperties = WMI4Java.get().VBSEngine().filters(Arrays.asList(filter_str)).getWMIObjectList("Win32_PnPEntity");
I added the VBSEngine() function in the middle.

But when I use the VBSEngine, I can get nothing back? It returns very quickly. When I use the default jpowershell it returns much slower but it give back some items back.

So how to use VBSEngine() do I need to install some packages?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants