;~ $sFileName = 'my.txt'
;~ $sFileName = 'my.dll'
$sFileName = 'my.html'
$hFile = FileOpen($sFileName, 16)
If $hFile = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
$iByte = FileRead($hFile, 2)
If StringCompare($iByte, '0x4D5A') = 0 Then ; exe, dll, ocx
ConsoleWrite('Бинарный файл!' & @CR)
Else
ConsoleWrite('Текстовый файл!' & @CR)
EndIf
FileClose($hFile)