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

Hi

I would like to add some perl programs to the windows menu that appears when you right click a file and then have the selected file(s) passed to the perl program for processing.

Is this possible? If so how is it done?

Cheers

Replies are listed 'Best First'.
Re: Adding perl programs to windows menus
by GrandFather (Saint) on Jul 08, 2009 at 11:55 UTC

    It is possible.

    It is done by adding registry entries for the appropriate file class. For example the following registry entries

    HKEY_CLASSES_ROOT .xyzzy (Default) = Colossal.1 Colossal.1 (Default) = Map Builder Shell (Default) = Plugh open command (Default) = c:/Perl/bin/wperl.exe c:/MapDir/EditMa +p.pl /o "%1" Plugh (Default) = &Plugh command (Default) = c:/Perl/bin/wperl.exe c:/MapDir/EditMa +p.pl /p "%1"

    would associate the file extension .xyzzy with a default Plugh action and also register an open action. Both actions would invoke the EditMap.pl script to do whatever it is that EditMap.pl does.

    Win32::TieRegistry may be useful in editing the registry. Note that I haven't tested any of this and that random poking around in the Windows registry may have unfortunate results.


    True laziness is hard work
Re: Adding perl programs to windows menus
by Anonymous Monk on Jul 08, 2009 at 11:36 UTC