RE: Strange behavour of Process

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi

Did the all the EXE are of Console Application?
Have you tried to write a test console application for a test to see if
that reproduce the problem?

Also from the document, it seems that we need to set the UseShellExecute to
false to redirect the output stream.
Setting this property to false enables you to redirect input, output, and
error streams.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemdiagnosticsprocessstartinfoclassuseshellexecutetopic.asp

Commonly, if your code works for all the other EXE, (I assume they are all
Console Application), I guess maybe the problem EXE file has do something
expecially.
I think you may also try to contact the EXE's develop for the source code,
so that we can check what is the problem.

Also I think you may try to call the CreateProcess directly to see if that
works for you.

Here are some articles for your reference.

How to spawn a process that runs under the context of the impersonated user
in Microsoft ASP.NET pages
http://support.microsoft.com/kb/889251

Desktop Switching
http://www.thecodeproject.com/csharp/CsDesktopSwitching.asp

If I have any misunderstanding, please feel free to post here.


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Console Windows Forms hybrid
    ... In the console application, if no parameters are passed on the ... just launch the EXE and then exit. ... it runs as a console app. ... This is workable - I have a little shim launcher program whose ...
    (microsoft.public.dotnet.languages.csharp)
  • Console window switch - vc2005 C++/clr/MASM project
    ... I have a project that mixes C++/clr and MASM in a single ... The exe starts with a console window which I don't want. ... I think it boils down to a linker switch - IIRC, ...
    (microsoft.public.vstudio.general)
  • Why do I get error 6 (The Handle is Invalid) trying to WriteFile to STDOUT from VB 6 exe?
    ... I create the following VB 6 app to write to STDOUT. ... I run the exe from a command line. ... I'm assuming somehow my vb app can't see the console it is being run from. ... I'd expect this failure running from the IDE but not from the command line. ...
    (microsoft.public.vb.winapi)
  • Re: Making a Winforms app behave like a Console app
    ... applicatio, the second is a console application, and the third is a lauch ... We can always run the launch.exe and run winform or console exe based ...
    (microsoft.public.dotnet.framework.windowsforms)