I am in the process of learning windows scripting and have run into a problem.
I have been asked to get a script working that was started by another user that is no longer with the company I am working for. The script is suppose to pull a zip file from our web servers over to another server and unzip them to the correct directories for processing through and application called clicktracks. currently I am getting an error stating "Loop without do" and I can't figure out what the problem is.

Here is an sample of the code

VB Code:
  1. Option Explicit
  2.  
  3. 'Declare Variables
  4. Dim objFSO,objWSHShell,objInFile,objFolder,objFile,objZipFolder,objZipFile,objLogFile
  5. Dim strDate,strMonth,strYear,strDay,strTargetFile1,strTargetfile2,strDeleteDate
  6. Dim strServer,strImageLib,strPrimaryWS,strVirtualWS,strStage,strSyntax,strExt,strZip
  7. Dim arrWebServerList,strFolder1,strFolder2,strFolder3,strFolder4,strFolder5,strFile1
  8. Dim strFile2,strFile3,strMovefile,strNetUse,strSource,strOutFile
  9.  
  10. 'Set Objects
  11. Set objFSO = CreateObject("Scripting.FileSystemObject")
  12. Set objWSHShell = CreateObject("WScript.Shell")
  13. Set objInFile = objFSO.OpenTextFile("C:\scripts\WebServerList.txt")
  14.  
  15. 'Determin Target Date
  16. strDate = Now()-1
  17. strMonth = CStr(Month(strDate))
  18. strYear = Right(CStr(Year(strDate)),2)
  19. strDay = CStr(Day(strDate))
  20.  
  21. 'If Month Single Digit then pad with leading zero
  22. If Len(strMonth) = 1 Then
  23.     strMonth = "0" & strMonth
  24. End If
  25.  
  26. 'If Day Single Digit then pad with leading Zero
  27. If Len(strDay) = 1 Then
  28.     strDay = "0" & strDay
  29. End If
  30.  
  31. 'Determin Target Files
  32. strTargetFile1 = "ex" & strYear & strMonth & strDay & ".zip"
  33. strTargetfile2 = "ex" & strYear & strMonth & strDay & ".log"
  34.  
  35. 'Target Delete Date
  36. 'strDeleteDate = Date -32
  37.  
  38. 'Read Web Server List
  39. Do While Not objInFile.AtEndOfStream
  40.     arrWebServerList = Split(objInFile.ReadLine,",")
  41.    
  42. strServer= arrWebServerList(0)
  43. strImageLib = arrWebServerList(1)
  44. strPrimaryWS = arrWebServerList(2)
  45. strVirtualWS = arrWebServerList(3)
  46. strStage = "D:\" & strServer & "\"
  47. strZip = "c:\winzip\winzip32"
  48. strFile1 = strPrimaryWS & strTargetfile2
  49. strFile2 = strVirtualWS & strTargetfile2
  50. strFile3 = strImageLib & strTargetfile2
  51.  
  52. 'Authenticate to Web Server
  53. strNetUse = "cmd /c netuse \\" & strServer & (Login information for server)
  54. objWSHShell.Run strNetUse,0,True
  55.  
  56. 'Zip file Exist on Server
  57. If objFSO.FileExists ("\\" & strServer & "\D$\Logs\ZipFiles\" & strTargetFile1) Then
  58.     Set objFile = objFSO.GetFile("\\" & strServer & "\D$\Logs\ZipFiles\" & strTargetFile1)
  59.     'Copy zip file From WebServer
  60.     objFOS.Copyfile objFile.Path, strStage & "\"
  61.    
  62. 'UnZip File to Local Directory
  63. strSyntax = strZip & " -e " & stgStage & "\" & strTargetFile1 & " " & "C:\"
  64. objWSHShell.Run strSyntax,0,True
  65.  
  66. 'Move File to Destination Directory
  67. If objFSO.FileExists ("c:\" & strFile1) Then
  68. objFSO.MoveFile strStage & strPrimaryWS & "\"
  69.  
  70. If objFSO.FileExists ("c:\" & strFile2) Then
  71. objFSO.MoveFile strStage & strVirtualWS & "\"
  72.  
  73. If objFSO.FileExists ("c:\" & strFile3) Then
  74. objFSO.MoveFile strStage & strImageLib & "\"
  75.  
  76. Elseif strExt = ".zip" Then
  77. objFSO.MoveFile objLogFile.Path,strStage & "completedZips\"
  78.  
  79. 'Disconnect From Web Server
  80. strNetUse = "cmd /c netuse \\" & strServer & /d"
  81. objWSHShell.Run strNetUse,0
  82.  
  83. End If
  84.  
  85.     Loop