Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1054518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-18 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found