assoc/ftype problems

Giganews Newsgroups
Subject: assoc/ftype problems
Posted by:  samwy…
Date: 13 Mar 2006

People seem to pop up from time to time reporting mysterious problems
with ASSOC/FTYPE, with their reports generally disbelieved.  I can now
be added to that group.  Here's an example of what I'm seeing:

#!/usr/bin/perl -w
use strict;
die 'args=',join(',',@ARGV);

C:\>assoc .pl

C:\>ftype Perl
Perl="c:\Perl\bin\perl.exe" "%1" %*

C:\>"c:\Perl\bin\perl.exe" ".\" a b c
args=a,b,c at .\ line 3.

C:\>".\" a b c
args= at C:\Documents and Settings\sdenton\ line 3.

>From any Explorer window, I can click on "Tools / Folder Options... /
File Types", scroll down to the PL entry and high-light it, and click
on "Restore".  Afterwards, the ASSOC and FTYPE commands continue to
give me the same results, but running the last command causes an "Open
With" dialog box to appear.  I can then re-specify the Perl Command
Line Interpreter and the latter (erroneous) behavior is re-instated.

If I look again at the Folder Options, the file type for PL is now "PL
File", while the ASSOC command still reports "Perl".  Looking in
REGEDIT, I see that the default value for HKEY_CLASSES_ROOT\.pl is also
set to "Perl", while the default value for
is unset.  The latter key also has an "Application" value set to
"perl.exe", but deleting it or changing it to the same value shown for
FTYPE causes things to break.  Deleting the entire registry key also
causes breakage.

I'm running all of this under Windows 2000 Advanced Server, Version 5.0
(Build 2195: Service Pack 4).  I strongly suspect that some security
patch has caused the ASSOC and FTYPE commands to be ignored in favor of
the Explorer settings.  Does anyone have any additional information to