DataDizzy
asked on
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.Shel l")
Dim strCmd As String
Dim intReturn As Integer
strCmd = "\\RemoteServerName\e$\Tes t\FileToRu n.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.
Among other things, I have tried:
Dim ShellObject = CreateObject("WScript.Shel
Dim strCmd As String
Dim intReturn As Integer
strCmd = "\\RemoteServerName\e$\Tes
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you! This worked for me.
D.
D.
http://biresort.net/wikis/ssis_tips/ssis-dinamically-call-a-ssis-package-filesystem-location.aspx
regards,
Pedro