Windows Server 2012 R2 Perl File Type Association

0

I can't figure out why Perl scripts are not receiving command line arguments in my environment. I ran this series of commands to try to validate all the configurations and demonstrate the problem output.

C:\Users\bmarty\Desktop>assoc .pl
.pl=PerlScript

C:\Users\bmarty\Desktop>ftype PerlScript
PerlScript=c:\tools\Perl64\bin\perl5.16.3.exe "%1" %*

C:\Users\bmarty\Desktop>.\test.pl a b c

C:\Users\bmarty\Desktop>c:\tools\Perl64\bin\perl5.16.3.exe .\test.pl a b c
abc

As you can see, there's a difference between the default command line for PL files and the one I typed manually, and I can't figure out why.

BlueMonkMN

Posted 2018-01-09T15:52:27.263

Reputation: 385

Answers

1

Apparently HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pl overrides the assoc and ftype information stored in HKEY_CLASSES_ROOT. Deleting the .pl key solved the problem.

It's not clear if there's a way to solve this problem outside of directly editing the registry in Windows 2012 R2 (prior versions of Windows had file type association editors in the GUI, but Windows 2012 R2 does not appear to have this).

BlueMonkMN

Posted 2018-01-09T15:52:27.263

Reputation: 385