#!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 $Outfile; open $Outfile, ">$PC.csv" or die "Unable to open $PC.csv\n"; 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; }
In reply to inventory.pl by tcf03
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |