Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Command line arguments not passed in Win7

by Laurent_R (Canon)
on Sep 17, 2013 at 19:02 UTC ( [id://1054518] : note . print w/replies, xml ) Need Help??


in reply to Command line arguments not passed in Win7

I don't have ActiveState Perl, but it works on portable Strawberry Perl and Windows 7:

PS C:\perl\strawberry-perl-5.18.0.1-64bit-portable\perl\bin> ./perl -e + " print qq/@ARGV\n/" foe bar foe bar

Replies are listed 'Best First'.
Re^2: Command line arguments not passed in Win7
by ccherri (Acolyte) on May 13, 2015 at 16:34 UTC

    In gratitude to the monks who have helped me in the past I wanted to add... I had the command line working on my Windows 7 machine and then had to re-image the hard drive for reasons I can't explain. After the re-image, the command line parameters would not work despite the assoc, ftype, and PATHEXT all being correctly set. After a frustrating day, I just started cruising the registry and found another entry for perl under HKEY_USERS\S-1-blah-blah-blah-Classes\pl_auto_file\shell\open\command. I added the %* and viola! ITS ALIVE!. Not sure why the new instance, but just wanted to throw out there for other frustrated monks. C

      Thanks! I've been going crazy trying to solve exactly the same problem. I searched the registry for 'Perl.exe' and found exactly the same entry as you. Clicked 'Modify' and added the %* and all my command line arguments are now passed into the Perl script.
      Thank you! I just had the same issue with Windows 10, and your suggested registry edit worked. There were several places in the registry where I added %* after the "D:\Strawberry\perl\bin\perl.exe" "%1".
        Before I tried your solution on Windows 10 with Active Perl,

        tryit.pl a b c

        using the ".pl" association to invoke Perl did not work, but

        perl tryit.pl a b c

        did work.

        Then I tried your solution of adding %* to reg entries with "C:\Perl64\bin\perl.exe" "%1", and that fixed it so now

        tryit.pl a b c

        works and can see ARGV. Thank you!