http://qs321.pair.com?node_id=959648


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

What do you get when you run this command?

>reg query HKLM\Software\Classes\Perl\Shell\Open\Command HKEY_LOCAL_MACHINE\Software\Classes\Perl\Shell\Open\Command (Default) REG_EXPAND_SZ "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?

Replies are listed 'Best First'.
Re^4: Win7, ASSOCiation , and @ARGV
by ww (Archbishop) on Mar 14, 2012 at 20:06 UTC
    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

      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.

      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').

      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!