SSIS Script Task to execute a .bat file or a scheduled task on a remote computer

I'm reasonably new to SSIS in SQL 2005 and have limited knowlege of scripting .bat files.  My problem is that we have a scheduled task on a remote server that I need to kick off from a SSIS Script Task and I need to know it completes successfully before I continue to the next steps.  The scheduled task runs successfully on the remote server and I can also successfully run the task from a .bat file on the remote server.  I need help with getting the SSIS package script task  to successfully execute either the remote task or the .bat file

Among other things, I have tried:

 Dim ShellObject = CreateObject("WScript.Shell")
        Dim strCmd As String
        Dim intReturn As Integer

        strCmd = "\\RemoteServerName\e$\Test\FileToRun.bat"

        intReturn = ShellObject.run(strCmd, , True)

        'MsgBox(intReturn)
        If intReturn = 0 Then

            Dts.TaskResult = Dts.Results.Success
        Else
            Dts.TaskResult = Dts.Results.Failure
        End If


Typically I find answers in previous postings from other people, but not this time, so I wonder if I'm even in the right ball park.   Any help, and/or sample code would be very much appreciated!

Thanks,
D.
DataDizzyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Reza RadConsultant, TrainerCommented:
you can run your .bat file with EXECUTE PROCESS TASK
and now if execute process task runned successfuly or not you can do appropriate work.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DataDizzyAuthor Commented:
Thank you!    This worked for me.

D.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.