in reply to Explorer's Right-Click Menu

Adding a right-click entry in Windows Explorer is done by adding a registry key at the right location. Look in the Microsoft documentation or, much easier, steal from the XP Power Toys. The "Command Prompt Here" extension adds such a right-click entry.

Personally, I've moved to adding a shortcut into the "Send To" menu instead, because the interface is more maintainable by the end user.

In both cases, you need to make sure that the command line is not your Perl script (.pl) but perl.exe -w "c:\your\Perl\script.pl" "%1", or your Perl script will never receive the command line arguments. My way of doing that is to actually call a batch file first:

@echo off rem First, chdir into the directory where this batch file (and our Per +l script) reside: cd /d "%~dp0" rem Now, invoke our Perl script: C:\perl\bin\perl.exe myscript.pl "%1"

Replies are listed 'Best First'.
Re^2: Explorer's Right-Click Menu
by Ace128 (Hermit) on Dec 21, 2005 at 14:13 UTC
    I wanted the menu to show up. (and depending on what is selected, different things are shown in the list (this is taken care of internally by Windows I suppose...) (Among other things, the "Send to" is shown in this list aswell...)

      So look at what registry key the XP Power Toys "Command Prompt Here" uses, use a similar key, and use Win32::TieRegistry to set it.

      A reply falls below the community's threshold of quality. You may see it by logging in.
Re^2: Explorer's Right-Click Menu
by Fletch (Bishop) on Dec 21, 2005 at 15:55 UTC

    I think you've misunderstood the OP (not that it's that hard to do with such a poorly phrased question); the way I read it they want to somehow programmatically get the right click menu to post itself.

    A reply falls below the community's threshold of quality. You may see it by logging in.