#! perl -slw use strict; die "You must supply an extension" unless @ARGV; for ( @ARGV ) { my( $extention, $type ) = split '=', `assoc $_ 2>nul`; warn "No association was found for extension '$_'" and next unless defined $type; chomp $type; my( undef, $cmd ) = split '=', `ftype $type 2>nul`; warn "No command was associated with type '$type'" and next unless defined $cmd; chomp $cmd; print "Extension '$_' is associated with type '$type' " . "\n\tand the command: '$cmd'"; } #### c:\test>AssocFtype.pl .pl .doc Extension '.pl' is associated with type 'Perl' and the command: '"c:\perl\bin\perl.exe" -sw "%1" %*' Extension '.doc' is associated with type 'OpenOffice.org.doc' and the command: '"C:\Program Files\OpenOffice.org 2.2\program\soffice.exe" -o "%1"'