(Perl)使用WMI获取系统信息
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(Perl)使用WMI获取系统信息相关的知识,希望对你有一定的参考价值。
# useful links:# (WMI space definition) http://msdn.microsoft.com/en-us/library/aa394084(VS.85).aspx
# (OLE usage on CPAN) http://cpan.uwinnipeg.ca/htdocs/Win32-OLE/Win32/OLE.html#Object_methods_and_properties
#!/usr/bin/perl -w # use binperl.exe wmi.pl to run. # have fun! # 2009/6/17 twitter.com/vinocui # # useful links: # (WMI space definition) http://msdn.microsoft.com/en-us/library/aa394084(VS.85).aspx # (OLE usage on CPAN) http://cpan.uwinnipeg.ca/htdocs/Win32-OLE/Win32/OLE.html#Object_methods_and_properties # use Win32::OLE; #my $wmi = Win32::OLE->GetObject("winmgmts://./root/cimv2") or die "failed to retrieve cimv2."; # winmgmts means to access WMI service. my $list, my $v; foreach $v (Win32::OLE::in $list){ } foreach $v (Win32::OLE::in $list){ } 0;
以上是关于(Perl)使用WMI获取系统信息的主要内容,如果未能解决你的问题,请参考以下文章