Questions

VBScript - Expected Loop

Tags:
+
0 Votes
Locked

VBScript - Expected Loop

AlAckley
I've a little script that checks for the existence of a file share and if it exists checks for the most recent file. I'm running into an expected Loop error within one area of the code and am hoping someone can give me a hand. The error appears after the If statement starts but before the Else. I tried adding a Loop prior to the Else but that gave a syntax error.

Do Until objFile.AtEndOfStream
shelfPath = objFile.ReadLine
i = i + 1
WshNetwork.MapNetworkDrive driveLetter, shelfPath
If Err.Number <> 0 Then objCreateFile.Write(shelfPath + " can't be reached")
Else
call checkShelf
End If
Loop

Clarifications

danekan

what is objCreateFile? not enough info provided by you, or perhaps the obvious problem if this is your complete script is you haven't defined objCreateFile.