Send a Message
to r0mmel




Jan 18, 2012

r0mmel Profile

Forums Owned

Recent Posts


VBScript Called by Batch File in Command Task does not work

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) : [CODE] C:\PowerCenter_Scr ipts\sendmailattac hment.vbs [/CODE] And here’s my VBScript (sendmailattachmen t.vbs): [CODE] Dim objOutl Set objOutl = CreateObject( "Outlook.Appl ication") Set objMailItem = objOutl.CreateItem (olMailItem) 'comment the next line if you do not want to see the outlook window 'objMailItem.Displ ay strEmailAddr = "[email protected]" objMailItem.Recipi ents.Add strEmailAddr objMailItem.Subjec t = "Test Email from PowerCenter" objMailItem.Body = "Hi, this is only a test." objMailItem.Attach ments.Add "C:\PowerCent er_Output_Files\fi le.csv" objMailItem.Send Set objMailItem = nothing Set objOutl = nothing Wscript.Quit [/CODE] Hope you guys could help me. I’ve been clueless for days. Regards, r0mmel  (Jan 18, 2012 | post #1)