Hi Will,

You only have to use the index if you enumerate two dirs at the same time. Since you have them after eachother, you can remove all indexes.

code:
;------Finds an Superdat in the Server path
$sdatName=Dir($ServPath + "sdat*.exe")
;------Look for a more recent superdat

While $sdatName <>"" And @ERROR = 0
If $sdatname <>""
$sname=$sdatname
EndIf
$sdatName=Dir() ; retrieve next file
Loop

;------Find an Extra dat file in the server path
$XdatName=Dir($ServPath + "*xdat.exe")
;------Look for a more recent extra dat file
While $XDatName <>"" And @ERROR = 0
If $XDatname <>""
$Xname=$XDatname
EndIf
$XDatName=Dir() ; retrieve next file
Loop

;------Look for the available engine version
$EngName=Dir($ServPath + "*eng.exe")
;------Look for a more recent Engine file
While $EngName <>"" And @ERROR = 0
If $EngName <>""
$Ename=$EngName
EndIf
$EngName=Dir() ; retrieve next file
Loop


If this doesn't help, maybe there is something wrong in another part of the script?

A forgotten ENDIF or a misplaced " can wreak havoc to your script.

_________________________
The Code is out there