04-28-2010, 10:19 AM
(This post was last modified: 04-28-2010, 10:20 AM by manishbhalshankar.)
Hi Bostonma,
Check this out:
Check this out:
Code:
Option Explicit
Const conForReading = 1
'Declare variables
Dim objFSO, objReadFile, contents
'Set Objects
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("C:\Temp\TextToRead.txt", 1, False)
'Read file contents
contents = objReadFile.ReadAll
'Close file
objReadFile.close
'Display results
wscript.echo contents
'Cleanup objects
Set objFSO = Nothing
Set objReadFile = Nothing
'Quit script
WScript.Quit()