I am trying to capture only the applications ‘DisplayName’ and the ‘InstallSource’ off a remote Win32 registry. However, I do not want any empty entries from the Registry – because I will be piping the results into Excel and I want to avoid any errors – Ultimately I would like to create an array of anonymous hashes contaning this information, but I am not able to do this for some reason, …I tried and tried! Can someone please help? Thanks.#! c:/perl/bin -slw use Win32::Registry; use vars qw/%data @source @target/; if ($HKEY_LOCAL_MACHINE->Connect($ARGV[0], my $root)) { print "\nSuccessfully connect to remote registry on $ARGV[0]\n"; if ($root->Open("Software\\Microsoft\\Windows\\CurrentVersion\\Unin +stall", my $Key)) { print "Obtaining software information....Please wait\n"; my @keys; $Key->GetKeys( \@keys ); for my $subkey ( @keys ) { $Key->Open( $subkey, my $x ) or die $^E; my %vals; my $rec; $x->GetValues(\%vals ); for my $item (keys %vals) { $rec->{app} = $vals{$item}[2] if ($item=~ /DisplayName/i); $rec->{path} = $vals{$item}[2] if ($item=~ /InstallSource/ +i); print "$rec->{app} : $rec->{path}\n"; #push (@source, $rec); } } } }
In reply to capturing entries from the Registry by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |