CrAzY hOuSe
Locos por la programación
Determinar si un fichero EXE es de Windows o de DOS
.net

Syndication

Esta función devuelve el tipo de fichero EXE que le indicas. Al llamar a la función le envías la ruta completa donde se encuentra el fichero, y la función devuelve TRUE si el fichero EXE es de Windows o devuelve FALSE si el ejecutable es del DOS.

Function TipoExe(Fichero As String) As Boolean
    Dim Car As String * 1, Canal As Integer
    
    Canal = FreeFile
    Open Fichero For Binary As #Canal
        Get Canal, 25, Car
    Close #Canal
    
    If Asc(Car) = &H40& Then
        ' Es de Windows
        TipoExe = True
    Else
        ' Es de DOS
        TipoExe = False
    End If
End Function

Posted dom, sep 12 1999 20:25 by Maverick
Filed under: ,

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?
MavericK
Powered by Community Server (Non-Commercial Edition), by Telligent Systems