25304

Question:
I am writing a perl script that will list the hotfixes installed in my system and check if any pre-requisite hotfixes are not available before beginning my program;
So I need to be able to enumerate the list of hotfixes in the system; <a href="http://windowsxp.mvps.org/qfe.htm" rel="nofollow">Here</a> there is a mention of using wmic to generate a html file. Is it possible to do this via a WMI query?
Answer1:I have figured out the answer for this myself!! There is a vbscript option provided <a href="http://msmvps.com/blogs/athif/archive/2005/11/20/76035.aspx" rel="nofollow">here</a>.
The perl version goes like this..
use Win32::OLE qw( in );
my $machine = ".";
my $WMIServices = Win32::OLE->GetObject ( "winmgmts:{impersonationLevel=impersonate,(security)}//$machine/root/cimv2" ) || die "cant call getobject";
my $HotFixCollection = $WMIServices->ExecQuery ( "select * from Win32_QuickFixEngineering" ) || die "Query Failed";
foreach my $hotfix ( in( $HotFixCollection )){
$hotfixID = $hotfix->{HotFixID};
print "Hotfix id is $hotfixID \n";
}