Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Win7, ASSOCiation , and @ARGV

by ww (Bishop)
on Mar 14, 2012 at 20:06 UTC ( #959657=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Win7, ASSOCiation , and @ARGV
in thread Win7, ASSOCiation , and @ARGV

C:\>reg query HKLM\Software\Classes\Perl\Shell\Open\Command HKEY_LOCAL_MACHINE\Software\Classes\Perl\Shell\Open\Command (Default) REG_SZ "C:\Perl\bin\perl.exe" "%1" %*
REG_EXPAND_SZ? My iggerance is showing, again or is that peculiar to the 64 bit version? ww


Comment on Re^4: Win7, ASSOCiation , and @ARGV
Download Code
Re^5: Win7, ASSOCiation , and @ARGV
by Corion (Pope) on Mar 14, 2012 at 20:10 UTC

    REG_EXPAND_SZ means that the value contains (or may contain) environment variables that are supposed to be expanded. Usually you have things like:

    %SYSTEMROOT%\System32\Drivers

    ... and have to hope that the application knows how to handle REG_EXPAND_SZ.

Re^5: Win7, ASSOCiation , and @ARGV
by BrowserUk (Pope) on Mar 14, 2012 at 20:23 UTC

    Try running this. It just might fix your problem:

    >reg add HKLM\Software\Classes\Perl\Shell\Open\Command /t REG_EXPAND_S +Z /d "c:\perl64\bin\perl.exe \"%1\" %*"

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Couldn't run from cmd, directly, despite various contortions (and the fact that I am Administrator), so, this AM, as suggested elswhere and in another context, stored your command as a .bat on desktop and right clicked to get the option to run as Admin.

      Bingo. No complaints and now the key has REG_EXPAND_SZ.

      Reboot is again in order to test the original script again.

      Post Reboot Update: :(

      Looks like time to reinstall.

      Update2: SOLVED! There's much useful info in this thread, which led to the conclusion that reinstalling Perl was the first best option. Using AS on Win7 (and probably elsewhere), right clicking the Perl executable in REMOVE PROGRAMS brings up 3 options, of which "Repair" uses the originally downloaded .msi.

      ... and, lo and behold, the quirks are gone!

Re^5: Win7, ASSOCiation , and @ARGV
by Not_a_Number (Parson) on Mar 14, 2012 at 20:26 UTC

    FWIW (and I'm even iggeranter than you in this respect): my (32-bit) win config, which seems to be identical to yours and runs an identical version of perl (see above), gives the same response as yours to the esoteric query suggested by BrowserUK:

    C:\>reg query HKLM\Software\Classes\Perl\Shell\Open\Command HKEY_LOCAL_MACHINE\Software\Classes\Perl\Shell\Open\Command (Default) REG_SZ "C:\Perl\bin\perl.exe" "%1" %*

    And yet, I get the expected output from your program.

      Now I don't know whether to say "Thank you" first... or to give priority to the "Ouch!"

      Nonetheless, your observation has to help point me to something odd about my setup.

      BTW, did you see BrowserUK's Re^5: Win7, ASSOCiation , and @ARGV? I suspect modifying his ref to Perl64 is another step to try... but I'm checking with him (and the 'morrass of technet, MS.com and other M$ docs').

        BTW, did you see BrowserUK's Re^5: Win7, ASSOCiation , and @ARGV?

        Yes, after I'd posted my above reply. But frankly, it's way over my head.

        But FWIW again, here's the full output of what I get from perl -V:

        As far as I remember, I didn't change any defaults during the AS installation...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (17)
As of 2014-12-18 16:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (58 votes), past polls