Re: Process.Start questions



See if this doesn't work: (this code is using CF 2.0, if you can't use that,
use OpenNETCF's API -- same syntax)

System.Diagnostics.ProcessStartInfo psi = new
System.Diagnostics.ProcessStartInfo(myExe, args);

psi.UseShellExecute = false;

System.Diagnostics.Process process = null;

process = System.Diagnostics.Process.Start(psi);

// Wait until process exits. Timeout should be enough to have it make

// sense to kill process if it expires.

bool exited = process.WaitForExit(timeout);


if (exited)

int exitCode = process.ExitCode;




"Steve B." <steve_beauge@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eTsJdU7OGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
The app I'm launching is an app written in C# too...
I've not found how to fix the exit code of the process in C#.

Writing a file is a possible way, but I don't found this solution
pretty...

Thanks,
Steve

<chris-s@xxxxxxxxxxxx> a écrit dans le message de news:
1141054022.124413.236480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Is the 'command line application' one that you have written yourself?
If so, can you store the result into the registry or a file or maybe
create/delete a file with a specified name to indicate the result being
returned?

Back in the days of DOS, you use to be able to exit an application with
a 'result code' and then pick this up, not sure whether the same is
available now tho.

Chris





.



Relevant Pages

  • Re: Report enhancements
    ... My point about PERFORM UNTIL EXIT is that I can certainly see the potential ... implementor, which potential doesn't exist for the PERFORM UNTIL FALSE case. ... providing the syntax with no ambiguities whatever. ...
    (comp.lang.cobol)
  • Re: Report enhancements
    ... EXIT PERFORM format would be a syntactic problem. ... The object code has a problem figuring out whether the> statement is executed under control of a PERFORM by examining the stack at> execution time ... ... >>> You are using semantics rather than syntax. ... > in CONDITION-1 being FALSE; there may be any number of FALSE values. ...
    (comp.lang.cobol)
  • Re: Report enhancements
    ... > stack at execution time. ... All our compilers need to generate for out-of-line EXIT PERFORM is DUPL, ... syntax but for functionality otherwise unavailable. ... in CONDITION-1 being FALSE; there may be any number of FALSE values. ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... As the person who wrote the initial proposal to add EXIT PARAGRAPH/SECTION ... Currently the EXIT PARAGRAPH/SECTION syntax can cause VERY unexpected results if ... > For those who have been following the "perform forever" and "exit perform> " threads, I'm just tidying up the first drafts of two proposals that> I hope to submit Real Soon Now to INCITS/J4 for evaluation and consideration> for a future standard, if nothing else so that they can be added to the> "candidates list" for future consideration. ... > One of these proposals relaxes the current restriction that an EXIT PERFORM> or EXIT PERFORM CYCLE statement may only appear within a PERFORM ... ...
    (comp.lang.cobol)
  • Re: API Calls
    ... >> ich verwende in einigen VBA Moduken API Calls. ... >> EXIT um Word zu beenden. ... >> EXIT problematisch werden kann. ... >The ExitProcess function ends a process and all its ...
    (microsoft.public.de.word.vba)