java wmi jar,是否存在一种可以在java中使用WMI类的方法

Hi i want to use WMI classes to find out the application and products information. But the problem is that i want to use java or any scripting language like python, javascript or perl. I have heard about JWMI, it may be an option. Can anyone help me regarding this???

解决方案

JavaScript and Java aren't the same thing.

JavaScript

JavaScript is available under Windows Scripting Host (WSH). With it, it is fairly easy to access WMI:

var loc = new ActiveXObject("WbemScripting.SWbemLocator");

var svc = loc.ConnectServer(".", "root\\cimv2");

coll = svc.ExecQuery("select * from Win32_Process");

var items = new Enumerator(coll);

while ( !items.atEnd() )

{

WScript.Echo(items.item().Name);

items.moveNext();

}

jWMI (Java)

jWMI is a small library to enable Java to make general WMI queries. It seems to be available here

It also seems easy to use (though I am not sure how powerful or complete it is):

String name = getWMIValue("Select Name from Win32_ComputerSystem", "Name");

WBEM (Java)

WMI is a Microsoft implementation of Web Based Enterprise Management (WBEM). There is also a Java implementation of general WBEM which will be at some level compatible with WMI.

This might be the most complete true Java implementation you're going to find. If your needs are above tiny scripting (such as implementing a WBEM/WMI provider), then you might want to look into this option.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值