There is a utility within Unix called "file" which is used to determine a file type, and it does it extremely well. It uses a text file called "magic" which defines how to identify a file type. Mine is a little old (RedHat 6.2) but it includes entries for MPGs.

You could use the text file and write your own code to use it, or better you may be able to find a version of "file" compiled for Windows/NT. MKS include it in their toolkit, but that is of course a commercial version.

Here's what file reported on a test:

code:
[root@pitbull test]# cp tennis.mpeg important_memo.doc
[root@pitbull test]# file important_memo.doc
important_memo.doc: MPEG video stream data


So, renaming the file won't hide it

**Update**
I found a windows version on Sourceforge

Here are some examples of it running on my system:

code:
C:\WINDOWS>file command.com
command.com: MS-DOS executable (EXE)

C:\WINDOWS>file system.ini
system.ini: ASCII text, with CRLF line terminators

D:\Audit\DubiousVids>file *
Mom2.mpg: MPEG system stream data
Pantsoff.avi: RIFF (little-endian) data, AVI

D:\My Documents>file *
Adding a user login.doc: Microsoft Office Document
AVCOLD.mdb: raw G3 data, byte-padded
Computacenter Script.doc: Microsoft Office Document
Contract: directory
Current Internet.vsd: Visio (TM) Drawing
Current Internet.wmf: ms-windows metafont .wmf
Data Centre.vsd: Visio (TM) Drawing
Data Centre.wmf: ms-windows metafont .wmf
Demon Change Request 001.doc: Microsoft Office Document
Demon MC change request.doc: Microsoft Office Document
Drawings.mdb: raw G3 data, byte-padded
EPC Check List.doc: Microsoft Office Document
epc.doc: Microsoft Office Document
HKRouter.txt: ASCII text, with CRLF line t
erminators
IP Addresses new Sites1.xls: Microsoft Office Document
Microsoft Office Document
Migrate.csv: ASCII text, with very long l
ines, with CRLF line terminators
MySQL Test.mdb: raw G3 data, byte-padded
Old Excel Documents.lnk: ms-Windows shortcut
PM2K.doc: Microsoft Office Document
Config.doc: Microsoft Office Document
sgb_ppr0081.PDF: PDF document, version 1.2
Shortcut to Northwind.lnk: ms-Windows shortcut
t.htm: HTML document text


[ 11 September 2001: Message edited by: Richard Howarth ]