I have another question about this. It's probably better to aks it here than to make a new thread about it.

This is the code I'm using now. It's a modified version of the code above to only check if the file is a valid AVI file:

Globals.SelectedFile is a filepath.
VB Code:
  1. Public Function GetFileType(xFile As String) As String
  2.     On Error Resume Next
  3.     Dim ID As String * 300
  4.  
  5.     Open xFile For Binary Access Read As #1
  6.     Get #1, 1, ID
  7.     Close #1
  8.  
  9.     If Mid(ID, 9, 8) = "AVI LIST" Then
  10.             MsgBox "This is an AVI file"
  11.         Else
  12.             MsgBox "This is NOT an AVI file"
  13.         Exit Function
  14.     End If
  15. End Function
  16.  
  17. Private Sub Form_Load()
  18. GetFileType (Globals.SelectedFile)
  19. End Sub

When I right-click on one AVI and run the application (from the Explorer right-click menu), then it works fine. But when I highlight multiple AVI files, right-click on them and run the application, then it always returns "This is NOT an AVI file", because it can only read one AVI file at a time.

Is there a way to check file 1 first, then file 2, then file 3, etc?
Like a batch process.