horndog wrote:
Ok this is my path: c:\blat\blat.bat how would you integrate this into:
Code:
Function RunCommand(sCommand)
Dim obShell
Set obShell = CreateObject("WScript.Shell")
obShell.Run sCommand, 0, true
Set obShell = Nothing
End Function
have the above function exactly as detailed somewhere in the eventhandlers.vbs
And somewhere else in the event handlers, somewhere that gets triggered as needed, like say inside the sub OnDeliverMessage(), have
call runCommand("C:\blat\blat.bat")
This is how I'd do it....
Code:
Sub SendSMS()
dim oApp, oMessage
Set oApp = CreateObject("hMailServer.Application")
MessageRecipientName = "Horndog"
MessageRecipientAddress = "0000000000@txt.att.net"
MessageSubject = "Email Alert"
' Give this script permission to access all
' hMailServer settings.
Call oApp.Authenticate("Administrator", "SecretPassword")
Set oMessage = CreateObject("hMailServer.Message")
oMessage.From = "server <server@yourdomain.com >"
oMessage.FromAddress = "server@yourdomain.com"
oMessage.Subject = MessageSubject
oMessage.AddRecipient MessageRecipientName, MessageRecipientAddress
oMessage.Body = "This is an auto generated alert." & vbNewLine & "Now to run the batch file!!"
oMessage.Save
call runCommand("C:\blat\blat.bat")
End Sub
Function RunCommand(sCommand)
Dim obShell
Set obShell = CreateObject("WScript.Shell")
obShell.Run sCommand, 0, true
Set obShell = Nothing
End Function
And then somewhere trigger the SendSMS Sub, perhaps even from your rule...
Not tested, but let me know how you get on.