title: Microsoft VBScript runtime error: Input past end of file error
body: <p>I am getting this error:</p>
  
  <p>"<strong>C:\se2.vbs(28, 6) Microsoft VBScript runtime error: Input past end of file</strong>"</p>
  
  <p>when I run my script (I italicized LINE 28):</p>
  
  <pre><code>Dim strInput
  Dim filesys
  Dim path
  Set filesys=CreateObject("Scripting.FileSystemObject")
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  Set oFSO = CreateObject("Scripting.FileSystemObject")
  
  objStartFolder = "C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7_1010\webapps\Geniisys\" 'Directory to search
  objTempFolder = "C:\Users\njediaz\Desktop\temp\"
  objOutputFile = "C:\Users\njediaz\Desktop\output\files.txt"
  
  strInput = InputBox("Enter file to search (case sensitive):")
  strSearchFor = strInput
  
  ShowSubfolders objFSO.GetFolder(objStartFolder)
  
  Sub ShowSubFolders(Folder)
  
     'Wscript.Echo Folder.Path
  
     For Each objFile in Folder.files
  
        ' Wscript.Echo Folder.Path &amp; "\" &amp; objFile.Name
  
         path = Folder.Path &amp; "\" &amp; objFile.Name
  </code></pre>
  
  <p><em>If InStr(oFSO.OpenTextFile(path).ReadAll, strSearchFor) > 0 Then</em></p>
  
  <pre><code>            filesys.CopyFile path , objTempFolder &amp; objFile.Name
          Else
              WScript.Sleep (100)
          END If
  
     Next
  
     For Each Subfolder in Folder.SubFolders
         ShowSubFolders Subfolder
     Next
  End Sub
  '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  'Script to log common files
  
  Set fs = CreateObject("Scripting.FileSystemObject")
  'Log file name
  Set logFile = fs.OpenTextFile(objOutputFile, 2, True)
  'Directory you want listed
  Set folder = fs.GetFolder(objTempFolder)
  
  Set files = folder.Files
    For Each file in files
      logFile.writeline(file.name)
    Next
  logFile.close
  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  'Script to delete
  
  Const DeleteReadOnly = TRUE
  
  Set objFSO = CreateObject("Scripting.FileSystemObject")
  objFSO.DeleteFile(objTempFolder &amp; "*"), DeleteReadOnly
  
  MsgBox "Done."
  </code></pre>
  
  <p>Help please! Thanks!</p>