Salve,
Ho uno script in vbs che controlla se in 2 file ci sono stringhe differenti.
Ora vorrei inviare il risultato della query via email.
Questo è lo script che uso per fare il matching dei files.
codice:
dim filename1
dim filename2
filename1="c:\test1.txt"
filename2="c:\test2.txt"
Set oFSO1 = CreateObject("Scripting.FileSystemObject")
Set oFSO2 = CreateObject("Scripting.FileSystemObject")
Set oTextFile1 = oFSO1.OpenTextFile(filename1, 1 , True)
Set oTextFile2 = oFSO2.OpenTextFile(filename2, 1 , True)
While oTextFile1.AtEndOfStream <> True
line1 = oTextFile1.ReadLine
line2 = oTextFile2.ReadLine
if (line1<>line2) then wscript.echo "I file sono diversi" & vbcrlf & line1 & vbcrlf & line2
wend
'if the second file has more strings i get the notify
if (oTextFile2.AtEndOfStream <> True) then wscript.echo "Different Files"
oTextFile1.close
oTextFile2.close
Questo è invece lo script che uso in genere per inviare email:
codice:
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "fox80129@xxx.xom"
objEmail.To = "test@xxx.com"
objEmail.Subject = "oggetto"
objEmail.Textbody = "testohardware"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.virgilio.it"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
wscript.echo "Response Retrieve Mail sent"
Vorrei semplicemente permettere allo script di inviare via email il risultato.
Grazie!