#!perl use strict; use Win32::API; my $filename="C:\\WINDOWS\\system32\\notepad.exe"; my $GetBinaryType ||= new Win32::API("kernel32", "GetBinaryTypeA", ['P','P'],'N') || die $^E; my $type = ' 'x5; my $Bool = $GetBinaryType->Call($filename, $type); print " $Bool, ($filename, $type)\n"; #$type should return one of the following values, but it returns nothing. :( # 0 A Win32 based application # 1 An MS-DOS based application # 2 A 16-bit Windows based application # 3 A PIF file that executes an MS-DOS based application # 4 A POSIX based application # 5 A 16-bit OS/2 based application