Subversion Repositories camp_sysinfo_client_3

Rev

Rev 229 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#! perl

# https://gallery.technet.microsoft.com/bdf35c43-9415-4e1c-9cfe-e035e38ba694

# simply exit if this is not Windows
BEGIN {
$^O eq "MSWin32" || exit;
}

our $VERSION = '0.1';

use Win32::OLE('in');
use constant wbemFlagReturnImmediately => 0x10; 
use constant wbemFlagForwardOnly => 0x20; 
 
$computer = "."; 
$objWMIService = Win32::OLE->GetObject 
    ("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n"; 
$colItems = $objWMIService->ExecQuery 
    ("SELECT * FROM Win32_SoftwareFeature","WQL",wbemFlagReturnImmediately | wbemFlagForwardOnly); 
 
foreach my $objItem (in $colItems) 
{ 
      print "Accesses: $objItem->{Accesses}\n"; 
      print "Attributes: $objItem->{Attributes}\n"; 
      print "Caption: $objItem->{Caption}\n"; 
      print "Description: $objItem->{Description}\n"; 
      print "Identifying Number: $objItem->{IdentifyingNumber}\n"; 
      print "Install Date: $objItem->{InstallDate}\n"; 
      print "Install State: $objItem->{InstallState}\n"; 
      print "Last Use: $objItem->{LastUse}\n"; 
      print "Name: $objItem->{Name}\n"; 
      print "Product Name: $objItem->{ProductName}\n"; 
      print "Status: $objItem->{Status}\n"; 
      print "Vendor: $objItem->{Vendor}\n"; 
      print "Version: $objItem->{Version}\n"; 
      print "\n"; 
} 
<STDIN>;