Let me preface by saying that I am not a VB Programmer.
a VB guy that used to work here setup a VB Script to run via windows job scheduler (his code below) to show the file attributes for 2 different files and then email the results.
What I would like to accomplish is to 'type' or display the contents of a small text file and then email the results. Can this be accomplished easily by modifying his script??? if so, can someone help me with the code?
___________________________________
'Script to get the last modified date for a file.
Dim fso, f1, f2
'Set the file attrribute to append
Const ForWriting = 8
Set fso = CreateObject("Scripting.FileSystemObject")
' Get a File object to query.
Set f1 = fso.GetFile("\\server\IT\file1.dmp")
set f2 = fso.GetFile("\\server\IT\file2.db")
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "email_address@server_name.ourdomain.com"
objEmail.To = "Distribution_Group@ourdomain.com"
objEmail.Subject = "IT Operations Status Report-DB backup Status"
objEmail.Textbody = f1.name & " " & f1.DateLastModified & " " & vbcrlf & vbcrlf & _
f2.name & " " & f2.DateLastModified
'== remote smtp configuration
objEmail.Configuration.Fields.Item _
(" = 2
'Name or IP of Remote SMTP Server
objEmail.Configuration.Fields.Item _
(" = "000.000.0.0"
'Server port (typically 25)
objEmail.Configuration.Fields.Item _
(" = 25
objEmail.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objEmail.Send
a VB guy that used to work here setup a VB Script to run via windows job scheduler (his code below) to show the file attributes for 2 different files and then email the results.
What I would like to accomplish is to 'type' or display the contents of a small text file and then email the results. Can this be accomplished easily by modifying his script??? if so, can someone help me with the code?
___________________________________
'Script to get the last modified date for a file.
Dim fso, f1, f2
'Set the file attrribute to append
Const ForWriting = 8
Set fso = CreateObject("Scripting.FileSystemObject")
' Get a File object to query.
Set f1 = fso.GetFile("\\server\IT\file1.dmp")
set f2 = fso.GetFile("\\server\IT\file2.db")
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "email_address@server_name.ourdomain.com"
objEmail.To = "Distribution_Group@ourdomain.com"
objEmail.Subject = "IT Operations Status Report-DB backup Status"
objEmail.Textbody = f1.name & " " & f1.DateLastModified & " " & vbcrlf & vbcrlf & _
f2.name & " " & f2.DateLastModified
'== remote smtp configuration
objEmail.Configuration.Fields.Item _
(" = 2
'Name or IP of Remote SMTP Server
objEmail.Configuration.Fields.Item _
(" = "000.000.0.0"
'Server port (typically 25)
objEmail.Configuration.Fields.Item _
(" = 25
objEmail.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objEmail.Send