Send Us a Sign! (Contact Us!)
VBScript - How to read .txt file for input –> (Word) VBScript - How to read .txt file for input –> (PDF) VBScript - How to read .txt file for input –> (Epub) VBScript - How to read .txt file for input –> (Text)
VBScript - How to read .txt file for input –> (XML) VBScript - How to read .txt file for input –> (OpenOffice) VBScript - How to read .txt file for input –> (XPS) VBScript - How to read .txt file for input –> (MHT)
This article has been published 2 years, 82 days ago
The estimated time to read this article is 3 minutes

VBScript – How to read .txt file for input
  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)

SCENARIO (Typical)

I’m having a bit of an issue, I have a text file with computer names in it and I am trying to read in each line and then perform a ping…

SOLUTION

Option Explicit
 Dim oFSO, sFile, oFile, sText
 Set oFSO = CreateObject("Scripting.FileSystemObject")
 sFile = "your text file"
 If oFSO.FileExists(sFile) Then
  Set oFile = oFSO.OpenTextFile(sFile, 1)
   Do While Not oFile.AtEndOfStream
    sText = oFile.ReadLine
     If Trim(sText) <> "" Then
      WScript.Echo sText
     End If
   Loop
  oFile.Close
 Else
  WScript.Echo "The file was not there."
 End If

VBScript – How to read .txt file for input
  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)

SOURCE

LINK

LANGUAGE
ENGLISH
VBScript - How to read .txt file for input VBScript - How to read .txt file for input
Facebook Twitter Email Plusone Linkedin Stumbleupon Delicious Digg
Add Comment Register



   
© 2011 - 2013 HeelpBook - Today is: 23/10/2014 Last updated: August 16, 2012 at 9:11 am Get helped -