Re: Console app to exit itself?



I know, but you run this from within VS (F5) isn't it? Try to run it from a
command prompt.

Willy.

"Ronnie Smith" <smith_ronnie@xxxxxxxxxxxxxxxx> wrote in message
news:8944D6E1-55D8-4F3F-99BA-020AE6A1AE70@xxxxxxxxxxxxxxxx
> Hi Willy,
>
> Thanks for your suggestion but it doesn't seem to make any difference.
> The message actually appears in the console window after it has completed.
> Even in the release version.
>
> Ronnie
>
> "Willy Denoyette [MVP]" wrote:
>
>>
>> "Ronnie Smith" <smith_ronnie@xxxxxxxxxxxxxxxx> wrote in message
>> news:43A13B0D-1215-40A4-BDE1-C1CD3200FAAE@xxxxxxxxxxxxxxxx
>> > Hi,
>> >
>> > I have a console app written in C# to kill a certain process. I don't
>> > want
>> > the console to come to the foreground when run and I want it to exit
>> > itself
>> > without waiting for the 'Press any key to continue' prompt at the end.
>> >
>> > How can I run it so that it is hidden and once it has completed exits
>> > quietly by itself?
>> >
>> > Many thanks,
>> >
>> > Ronnie
>>
>> Set the ProcessStartInfo WindowStyle property to
>> ProcessWindowStyle.Hidden
>> like this...
>>
>> ProcessStartInfo startInfo = new ProcessStartInfo(".....");
>> startInfo.WindowStyle = ProcessWindowStyle.Hidden;
>>
>> The "press any key to..." comes from the debugger windows isn't it?
>>
>>
>> Willy.
>>
>>
>>
>>


.



Relevant Pages

  • Re: Restart after windows update fails
    ... Boot to the console and press enter when asked for the password. ... Try system restore from command prompt. ... some tools and info here for recovering lost passwords. ...
    (microsoft.public.windowsxp.perform_maintain)
  • DWMX comes up for .net executable
    ... Then went to the console (command ... Well when I go to execute the program Dreamweaver opens up in the code ... of the picture and my program to execute through the command prompt ...
    (microsoft.public.vsnet.setup)
  • Re: Console and Form together in one application based on EXE parameters
    ... application opens a second console window, ... If the program was started from a command window, then AttachConsole will find that window and use it. ... AttachConsole will return False and AllocConsole will create a new window. ... The program is able to write to the parent's console window, but since the command prompt executed the program asynchronously, it still prompts for additional commands. ...
    (comp.lang.pascal.delphi.misc)
  • Re: I/O with Spanish words
    ... solartimba wrote: ... Latin, where most Spanish is written, and the console (or "Command Prompt") ... Keyboard rate: 31 ...
    (comp.lang.cpp)