In Windows 10, what default behavior can I expect when a file extension association exists, but a File Type Open Command String has not been set?

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?

Answer

What do I lose if “FileType=OpenCommandString” is not set?

Apparently, I lose

Strawberry Perl takes a non-standard approach in setting up its file associations. Instead of the proper Programmatic Identifier (ProgID) format, [Vendor or Application].[Component].[Version], it sets ProgID to “Perl_program_file”. As described in Windows File Types documentation, they then implement a new, descriptive verb, Execute Perl Program, rather than use Open.

While non-standard, the approach is sufficient. Per Extending Shortcut Menus – Windows Docs (Windows 2000 and later),

The default verb is displayed first on the shortcut menu. Its purpose
is to provide the Shell with a verb it can use when ShellExecuteEx is
called but no verb is specified. The Shell does not necessarily select
the default verb when ShellExecuteEx is used in this fashion. …the
Shell uses the first available verb from the following list. If none
are available, the operation fails.

  • The open verb
  • The default verb
  • The first verb in the registry
  • The openwith verb

Additional references:

Attribution
Source : Link , Question Author : SoFarther , Answer Author : SoFarther

Leave a Comment