merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

What is the best way of finding the full directory path of standard applications such Excel and Internet Explorer?
I feel that the registry would be good but I am struggling to find a reference to their .exe in the registry.
I have been looking in HKEY_LOCAL_MACHINE->SOFTWARE.

Replies are listed 'Best First'.
Re: finding standard appliiations .exe
by cdarke (Prior) on Nov 02, 2009 at 17:19 UTC
    Try Win32::FetchCommand

    It searchs HKEY_CLASSES_ROOT for file associations, and gets the path from there.
      I will try this as well!
Re: finding standard appliiations .exe
by ikegami (Patriarch) on Nov 02, 2009 at 17:17 UTC

    For starters, not only are neither standard, one of then never comes with Windows.

    There's no generic registration mechanism for locating applications. It doesn't make much sense. It presumes there will only be only one installation of one version of an application on the machine.

    I don't know why you'd want to know that information anyway. If you want to load a document, use the user's preferred application:

    system(qq{start "" "$doc"});
      I wanted this so that I can start the applciation. However, your method looks useful.
      I will try it
Re: finding standard appliiations .exe
by Khen1950fx (Canon) on Nov 02, 2009 at 20:29 UTC
    I've been using SVN::Notify to find executables. Try this:

    #!/usr/bin/perl use strict; use warnings; use ExtUtils::MakeMaker qw(prompt); use File::Spec; use SVN::Notify; my $exe_name = prompt("Enter name of exe: "); my $exe = SVN::Notify->find_exe($exe_name); print "$exe\n";