Alright, Mr. VB I'm not, and I'm okay with that, but I'm about to throttle this thing. Also, sorry for a longish absence from here, work's been nuts.
Here's the scenario: I'm working against a third party app that I have to call a .bat file from. It's actually a bit deeper than that but let's start there. It returns multiple exit codes depending on what happens, and some of them the SSIS needs to consider a success, and some a failure.
Due to this, the Execute Process Task Editor isn't working for me. I need to basically store the exit code and make decisions from there. With that as the overall scenario, allow me to simplify the case.
First, two Batch files:
EXIT /B 22
ECHO "Return exit code from Testbatch.bat"
EXIT /B %errorlevel%
Stuff this in your local directory of choice. I use C:\scratchpad.
Fire it off via cmd.exe and you'll get some stuff on screen. No problem.
My problem stems from trying to capture this stuff. Really, I want the 22 that's being returned by the EXIT /B %errorlevel%. I'll take whatever I can get. My google-fu is fail, but it's gotten me somewhat close.
Public Sub Main()
Dim StInfo As New ProcessStartInfo("C:\scratchpad\TestBatch2.bat")
Dim proc As New Process
Dim str As String
StInfo.UseShellExecute = False
StInfo.RedirectStandardOutput = True
proc.StartInfo = StInfo
Using oStreamReader As System.IO.StreamReader = proc.StandardOutput
str = oStreamReader.ReadToEnd()
Dts.TaskResult = ScriptResults.Success
The Msgbox comes up BLANK. I can't figure out how to trap the blinking results.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]