<?xml version="1.0" encoding="windows-1252"?>
<node id="277756" title="Re: (Not Quite Perl) Running Scripts from Right-Click Context Menu in Windows" created="2003-07-24 20:05:41" updated="2005-07-07 15:16:58">
<type id="11">
note</type>
<author id="247561">
svsingh</author>
<data>
<field name="doctext">
Instead of making my coworkers play with the registry, I thought I'd try to automate these steps too.  If you're interested, here's a generic installer I whipped up.  Just copy the code into a text editor and save it as a .reg file.  Then double click on the .reg file to populate the registry.

&lt;code&gt;
REGEDIT4

; Replace the following values with your own information.
;
; &lt;INTERNALNAME&gt; = A name for the shortcut. This will not
;                  be seen, so just use alphanumeric chars.
;                  You must change this twice below.
; &lt;DISPLAYNAME&gt; = The name of the right-click shortcut.
; &lt;PATH_AND_FILE&gt; = The path to the Perl script.  Use double
;                   backslashes.  For example:
;                   c:\\scripts\\foo.pl

[HKEY_CLASSES_ROOT\Directory\shell\&lt;INTERNALNAME&gt;]
@="&lt;DISPLAYNAME&gt;"

[HKEY_CLASSES_ROOT\Directory\shell\&lt;INTERNALNAME&gt;\command]
@="perl.exe &lt;PATH_AND_FILE&gt;.pl \"%L\""
&lt;/code&gt;

&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Added "%L" to pass the directory to the script.  Thanks [BrowserUK] and [Intrepid].</field>
<field name="root_node">
277596</field>
<field name="parent_node">
277596</field>
</data>
</node>
