I am trying to get the following to give me 1 filename out of 10 in
the same directory with the current date. I cannot seem to get "=" to
work in my If Then statement. If I use "<", ">", or "<>" instead of
"=" it will give me a message box for each and every file in the
directory.

If anyone could give me a hand on why this wont work it would be
appreciated.

Thanks



datevar = date()

Set fso = CreateObject ("Scripting.FileSystemObject")
Set f = fso.GetFolder("C:\Documents and Settings\Administrator\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data\")



For Each file In f.Files
datevar2 = FormatDateTime(file.DateLastModified, vbShortDate)
IF datevar=datevar2 THEN
msgbox file.name
END IF
Next