I needed to go through a number of servers and check what hotfixes had been installed. I had a feeling Win32::TieRegistry could do that for me. The code needed to do so is surprisingly short.
It took me about 20 seconds to read the documentation and do the following. Bravo tye. My only gripe is that I typed in slashes rather than backslashes, and it didn't like that (although this was written on a 5.6.1 installation, for all I know this is fixed in more recent versions).
#! perl -w use strict; use Win32::TieRegistry; use constant BASE => 'LMachine\\Software\\Microsoft\\Windows NT\\Curre +ntVersion\\HotFix\\'; my $fix = $Registry->{+BASE} or die "oops, not admin? ($^E)\n"; foreach my $f( sort keys %$fix ) { chop(my $id = $f); my $desc = $Registry->{BASE.$f}{Comments} || '<no description>'; print "$id\t$desc\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Enumerate hotfixes applied to a Windows server (2000, 2003) (import)
by tye (Sage) on May 05, 2005 at 02:45 UTC | |
by eyepopslikeamosquito (Archbishop) on May 05, 2005 at 03:51 UTC |
Back to
Cool Uses for Perl