grashoper has asked for the wisdom of the Perl Monks concerning the following question:
#!Perl use strict; use Win32::TieRegistry(Delimiter=>"/"); # I have an environmental variable set with computernames # so I utilize that... # my $PC = "MYPC"; my $PC = $ENV{COMPUTERNAME}; # Get the Installed software my %Uninstall = %{ $Registry->{"//$PC/HKEY_LOCAL_MACHINE/SOFTWARE/Micr +osoft/Windows/CurrentVersion/Uninstall"} }; my $version; my $Outfile; my $fh2; open $Outfile, ">$PC.csv" or die "Unable to open $PC.csv\n"; system ( "ver > $PC.CSV"); foreach my $Keys ( sort keys %Uninstall ) { print $Outfile join(',', &escape($Uninstall{$Keys}->{'/Publisher'} +), &escape($Uninstall{$Keys}->{'/DisplayVers +ion'}), &escape($Uninstall{$Keys}->{'/InstallDate +'}), &escape($Uninstall{$Keys}->{'/DisplayName +'}), &escape($Keys))."\n"; } sub escape { my $entry = shift; $entry =~ s/,//g; $entry =~ s/\///g; return $entry; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: software inventory
by moritz (Cardinal) on May 12, 2008 at 20:21 UTC | |
|
Re: software inventory
by toolic (Bishop) on May 12, 2008 at 20:30 UTC | |
|
Re: software inventory
by Old_Gray_Bear (Bishop) on May 12, 2008 at 21:52 UTC | |
by grashoper (Monk) on May 12, 2008 at 22:10 UTC | |
by grashoper (Monk) on May 12, 2008 at 22:36 UTC | |
|
Re: software inventory
by NetWallah (Canon) on May 12, 2008 at 21:21 UTC | |
by grashoper (Monk) on May 12, 2008 at 22:08 UTC | |
|
Re: software inventory
by chromatic (Archbishop) on May 13, 2008 at 03:20 UTC |