in reply to Re: How to obtain a list of software applications installed on a Win based PC?
in thread How to obtain a list of software applications installed on a Win based PC?

Hi

I tried this bit of code, however I did not get any information about the installed applications (only 'Done' was displyed).

Can some one shed light on this for me please.

use strict; use Win32::Registry; my $Key; if ($HKEY_LOCAL_MACHINE->Open("Software\\Microsoft\\Windows\\CurrentVe +rsion\\Uninstall", $Key)) { print "\nDone1\n"; my %ValueList; $Key->GetValues(\ %ValueList); # nothing happens here! for my $item (keys(%ValueList)) # nor here { print "\nDone2 $item\n"; print "$item : $ValueList{$item}[2]\n"; } print $Key->{DisplayName}."\n"; $Key->Close(); }
Thanks for the help indeed.
  • Comment on Re: Re: How to obtain a list of software applications installed on a Win based PC?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: How to obtain a list of software applications installed on a Win based PC?
by BrowserUk (Patriarch) on Jun 01, 2004 at 15:49 UTC

    You need to distinguish between what are termed "Keys" and what "Values". This may get you started.

    #! perl -slw use strict; use Win32::Registry; use Data::Dumper; my $key; $HKEY_LOCAL_MACHINE->Open( "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", $key ) or die $^E; my @keys; $key->GetKeys( \@keys ); for my $subkey ( @keys ) { $key->Open( $subkey, my $x ) or die $^E; my %vals; $x->GetValues( \%vals ); print Dumper \%vals; }

    You may also want to consider Win32::TieRegistry.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail