Hi,
I am trying to execute a sql script and storing the script in a file at install time eg: sss.log file. Now I want to display the file content i.e. sss.log file content in a message box. Following is the vb script for reading the file content :
Option Explicit
Const conForReading = 1
'Declare variables
Dim objFSO, objReadFile, contents
'Set Objects
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile("D:\dbscript\sss.log", 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()
I have placed the script in a readfile.vbs file. I need to execute this script once the sss.log is getting created. Please let me know how to do it.
Its urgent issue. Need your immediate help..
Regards
Sony
FOLLOW US
Get the latest news in Application Packaging