With so many file extensions in use, it would seem like a common request. So I present this Perl function to automate this lookup.
—John
use strict; use warnings; use Win32::TieRegistry 0.20 (Delimiter=>"/"); sub get_file_association ($) { my $x= shift; my $reg= $Registry->{"HKEY_CLASSES_ROOT/$x//"} or return; # this usually refers to another entry. $reg &&= $Registry->{"HKEY_CLASSES_ROOT/$reg//"} if $x =~ /^\./; return $reg; } # print get_file_association ('.chm'); foreach (@ARGV) { print $_, '=>', (get_file_association($_) || "NOT KNOWN"), "\n"; }
In reply to Windows file extensions by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |