![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have a DTS with a Execute Process Task where i call a run.cmd. The run.cmd itself call a .net console application that on error returns a exitcode = 1. In the cmd if i make echo %errorlevel% it returns me 1. till now all is fine. In DTS i have set the returncode off the execute process task as 0. Why it doesn't raises the onfailure workflow?!?!? what does i make wrong?!?!? please help me thx |
#2
| |||
| |||
|
|
hmm this isn't the solution because e call a run.cmd that make this @echo off pushd c:\temp\ echo get current date's string ... rem s00004: for /f "tokens=2,3,4 delims=/-. " %%i in ('date /t') do set datestring=%%k%%i%%j for /f "tokens=1,2,3 delims=/-. " %%i in ('date /t') do set datestring=%%k%%i%%j echo search for unused file-name ... for /l %%i in (999, -1, 1) do if not exist %datestring%.%%i.* set filename=%datestring%.%%i echo starting exe \\dev0\d$\prov_applications\Popcorn\ImportContract s\it.bz.prov.Popcorn.PF.Im |
|
echo Error: %errorlevel% set myErrorLevel = %errorlevel% errorlevel = %errorlevel% echo cleaning up... set datestring= set filename= set myErrorLevel= popd the it.bz.prov.Popcorn.PF.Import.exe is a .net console programm that makes on error this System.Environment.ExitCode = 1; but the execute process task don't know that the .net application has failed. How can i passed this information? thx "Darren Green" wrote: I am confused by your description, What is the run.cmd? If I use a simple .Net console application exe, and "return" a value from it, when run from the exec process task it will fail or succeed as expected when the return set in the program value does not match the "Return code" set in the task. If the return value does not match the task configured return code, then the task is failed, and the on failure workflow is followed as expected. Just for info here is my simple test app- using System; namespace ConsoleReturn { /// <summary /// Summary description for ConsoleReturn. /// </summary class ConsoleReturn { /// <summary /// The main entry point for the application. /// </summary [STAThread] static int Main(string[] args) { int ret = 0; Console.WriteLine("ConsoleReturn.exe <return value>"); try { ret = Convert.ToInt32(args[0]); Console.WriteLine("Return value " + ret.ToString() + " will be returned."); } catch { ret = 0; Console.WriteLine("No return value supplied. A default of 0 will be used."); } return ret; } } } -- Darren Green http://www.sqldts.com "stoffi" <stoffi (AT) discussions (DOT) microsoft.com> wrote in message news:41D31884-050A-44C6-BE0A-93E62611AB1E (AT) microsoft (DOT) com... I have a DTS with a Execute Process Task where i call a run.cmd. The run.cmd itself call a .net console application that on error returns a exitcode = 1. In the cmd if i make echo %errorlevel% it returns me 1. till now all is fine. In DTS i have set the returncode off the execute process task as 0. Why it doesn't raises the onfailure workflow?!?!? what does i make wrong?!?!? please help me thx |
![]() |
| Thread Tools | |
| Display Modes | |
| |