r0mmelforums
Technical User
Hi Everyone,
I have a Windows batch file in a command task that calls a VBScript. It is working when I run the batch file manually, but when I run it through the command task, it doesn’t work. It just keeps running and does not stop.
Here’s my batch file (cmdSendEmail.bat):
And here’s my VBScript (sendmailattachment.vbs):
Hope you guys could help me. I’ve been clueless for days.
Regards,
r0mmel
I have a Windows batch file in a command task that calls a VBScript. It is working when I run the batch file manually, but when I run it through the command task, it doesn’t work. It just keeps running and does not stop.
Here’s my batch file (cmdSendEmail.bat):
Code:
C:\PowerCenter_Scripts\sendmailattachment.vbs
And here’s my VBScript (sendmailattachment.vbs):
Code:
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
'comment the next line if you do not want to see the outlook window
'objMailItem.Display
strEmailAddr = "my.email@company.com"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Subject = "Test Email from PowerCenter"
objMailItem.Body = "Hi, this is only a test."
objMailItem.Attachments.Add "C:\PowerCenter_Output_Files\file.csv"
objMailItem.Send
Set objMailItem = nothing
Set objOutl = nothing
Wscript.Quit
Hope you guys could help me. I’ve been clueless for days.
Regards,
r0mmel