WMI(windows Management Instrument)架构

WMI为应用程序和脚本提供了一种统一的方式来获取和设置计算机系统、网络或企业中的管理数据。它包括组件如WMI提供者、管理对象和WMI消费者。WMI提供者通过COM对象监视和提供管理对象的数据,而WMI消费者通过COM API或脚本API与WMI交互,获取如操作系统版本等信息。
摘要由CSDN通过智能技术生成

编程获取或者写入操作系统的信息, 只需要关注WMI consumers这一层.  通过C/C++之外的语言, 就仅仅考虑 COM API for WMI or the Scripting API for WMI 这两种方式的第二种. 

 

Example: 通过ruby获取操作系统的版本信息, 采用Scripting API for WMI 这种方式

 

WIN32OLE.connect('winmgmts:\\\\.').ExecQuery("select * from Win32_OperatingSystem" ).each do |m| 
p "#{m.Caption} SP#{m.ServicePackMajorVersion}" 
end 
 

 

 

WMI provides a uniform interface for any local or remote applications or scripts that obtain management data from a computer system, a network, or an enterprise. The uniform interface is designed such that WMI client applications and scripts do not have to call a wide variety of operating system application programming interfaces (APIs). Many APIs cannot be called by automation clients like scripts or Visual Basi

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值