0
Installation of Strawberry Perl 5.30.0.1 inspired this question. Users of Active Perl have reported problems with the <FileType>=<OpenCommandString>
pairs created during the installation of Active Perl. For example, ftype perl
at the command prompt returned perl="C:\Perl\bin\perl.exe" "%1"
. The named pair should have read perl="C:\Perl\bin\perl.exe" "%1" %*
if you wanted the invocation of file.perl arg1 arg2
to use the trailing arguments.
Strawberry Perl's installation created an association with the extension '.pl'. assoc .pl
returns .pl=Perl_program_file
. But searching the output of ftype
returns no <FileType>=<OpenCommandString>
pairs including the word 'perl' or the extension '.pl'. 'Perl interpreter' appears with '.pl' ('Perl program file') in the list 'Settings > Apps > Default Apps > Choose default apps by file type' in the Settings app.
Now my question - what is the default Open Command String issued when I double-click on a file with an associated file extension if <FileType>=<OpenCommandString>
has not been set? Is it something like <FileType>="C:\Path\" "%1" %*
? Here "%1" is substituted for the file name, %* is substituted for a list of arguments, per documentation (ftype - Microsoft Docs).
What do I lose if <FileType>=<OpenCommandString>
is not set?
The named pair should really have read
perl="C:\Perl\bin\perl.exe" %*
. What do you have inregedit
forHKEY_CLASSES_ROOT\.pl
? – harrymc – 2019-07-13T18:35:28.140You've set me on the right track by pointing to the registry. I focused too narrowly.
ftype <FILETYPE>
returns a value only if an Open Command String is defined. "Open" is only one Verb that Strawberry Perl could set as the Default for ".pl". It appears that they have introduced a non-canonical verb, "Execute Perl Program", as the Default (Computer\HKEY_CLASSES_ROOT\Perl_program_file\shell\Execute Perl Program\command = C:\Perl\Strawberry\perl\bin\perl.exe "%1" %*
). – SoFarther – 2019-07-15T19:56:00.440If you still need help, please add a screenshot with the contents of that registry key. – harrymc – 2019-07-15T20:11:24.053
Your first comment was perfect. It led to an improved understanding of how Windows handles file association. I'll compose an answer. As for the value of the named pair set by Strawberry Perl and recommended elsewhere,
C:\Perl\Strawberry\perl\bin\perl.exe "%1" %*
, "%1" appends the filename for which, here,Execute Perl Program
was called. I guess it would require a new question to explore effects of dropping "%1". I'll keep it in mind and do so if the current configuration leads to problems. – SoFarther – 2019-07-15T20:33:29.367