- 论坛徽章:
- 0
|
贴出来与大家共享:- #!/usr/bin/perl
- use strict;
- use Win32::OLE qw(in);
- use Win32::OLE::Variant;
- my $strComputer = '.';
- my $objWMIService = Win32::OLE->GetObject('winmgmts:' .
- '{impersonationLevel=impersonate}!\\\\' . $strComputer .
- '\\root\\cimv2');
- my $wql = 'SELECT * FROM Win32_Processor';
- my $results = $objWMIService->ExecQuery($wql);
- print "The Processor Information of this computer is as follows:\n\n";
- foreach my $obj (in $results) {
- print "Manufacturer : ", $obj->Manufacturer, "\n";
- print "Name : ", $obj->Name, "\n";
- print "ProcessorId : ", $obj->ProcessorId, "\n";
- print "UniqueId : ", $obj->UniqueId, "\n";
- print "Version : ", $obj->Version, "\n";
- print "Description : ", $obj->Description, "\n";
- print "DeviceID : ", $obj->DeviceID, "\n";
- print "MaxClockSpeed: ", $obj->MaxClockSpeed, "\n";
- print "LogProcessors: ", $obj->NumberOfLogicalProcessors, "\n";
- print "ProcessorType: ", $obj->ProcessorType, "\n";
- print "VoltageCaps : ", $obj->VoltageCaps, "\n";
- }
- <STDIN>;
复制代码 |
|