Hi All,

any ideas why this is not working? @error returns 0 for both Dir() calls, but it gets in an infinite loops at ?"hello5:" and the filename is simply "."?

Code:
 
break on
Dim $Directory $Directory = "\\server\share"
Dim $f $f = CreateObject("Scripting.FileSystemObject")

?"hello1"
If Exist ($Directory)
$Folder = Dir($Directory)
?"Hello2: " + $Folder + " error: " + @error

While $Folder <> "" and @ERROR = 0 ;and $f.IsFolder($Directory +
$Folder)
?"hello3"
If $Folder <> "." or $Folder <> ".."
$FileName = Dir($Directory + $Folder, 1) ; retrieve next file
?"hello4 error: " + @error
While $FileName <> "" or $Filename <> "." or $FileName <> ".."
and @error = 0
If $Filename <> "." or $Filename <> ".."
? "Directory: " + $Directory + $Folder
?"hello5:" + $FileName
If Right($FileName, 4) = ".htm"
?$Filename + " is htm file"
EndIf

EndIf
$FileName = Dir($Directory + $Folder, 1)
? " Getting new filename: " + $Filename
Loop
EndIf
$Folder = Dir($Directory)
Loop
endIf