IsExecutableFile - Returns whether the file is an executable
' Returns a boolean indicating whether the file is an executable
Function IsExecutableFile(ByVal filePath As String) As Boolean
' add more extensions if you wish
Dim extensions() As String = New String() {".exe", ".bat", ".com", ".pif"}
' return true if the extension of the specified file is contained in the
' array above
Return (Array.IndexOf(extensions, New System.IO.FileInfo(filePath) _
.Extension) > -1)
End Function