How can one pass command line arguments via file association in Vista 64?
I recently built a PC running Vista Ultimate 64-bit. I noticed several of the Perl scripts I t
I just tried ActivePerl-5.10.0.1004-MSWin32-x64-287188.msi on my Vista 64 Ultimate and it worked.
F:\prog\perl>foo.pl 1 2 3
3 arguments read
C:\Perl64\bin\perl.exe
That means devio is right: it must be an "file association" issue;
On an explorer, right-click on your .pl file and ask "Open with": use the "Perl Command Line interpreter" and it will work (and select "always use this program to open this type of file").
To me, "Vista's file extension manager removed the ability to pass arguments to functions" seems wrong...
I do see:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Perl\shell\Open\command]
@="\"C:\\Perl64\\bin\\perl.exe\" \"%1\" %*"
Meaning if your installation did not put that kind of value in your registry, it is because:
Note:
\"C:\\Perl64\\bin\\perl.exe\" \"%1\"
without the %*
argument) Vista's file extension manager removed the ability to pass arguments to programs. You have to manually edit the registry like devio mentions (or use another program to edit file extensions).
Don't know about Vista and 64bits, but under "classic" versions of Windows you can edit the registry:
HKEY_CLASSES_ROOT\.pl
contains default string "Perl"
HKEY_CLASSES_ROOT\Perl\shell\open\command
contains the default string:
"C:\path-to\Perl\bin\perl.exe" "%1" %*
where %* is a macro for all parameters following the first. Probably the %* is missing.
Also interesting to know for a Perl beginner is that ARGV is case-sensitive ... just spend an hour trying to find out why my command line parameters are not passed, and it was just that I used argv[0] instead of ARGV[0] ...