473,508 Members | 2,079 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stop command prompt from showing up for new process

Hello all,

I am trying to read in all the output from netstat.exe into my
program. While I have been successfull in doing so, I have some issues
that I cannot solve. I don't want the black window to show up, I want
it run in the background. The black window doesn't show anything in it
as I've already redirected the output to a stream. In any case, here
is my code:

Process process = new Process();
process.StartInfo.FileName = "netstat.exe";
process.StartInfo.Arguments = "-a -p TCP -b";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;

// start the process
process.Start();

I have fooled around with the StartInfo.WindowStyle and set it to
hidden, but it doesn't seem to do anything. I have also tried
Minimized and Maximized and they don't do anything either. Has anybody
figured out a way of doing this? Maybe Process isn't the right class
to use?

Any suggestions would be welcomed.

Thanks
Nov 16 '05 #1
3 2616
Hi Zamil,

Scroll up a little bit in the Intellisense and you'll find the
StartInfo.CreateNoWindow property.

Cheers.

"Zamil" <zm****@hotmail.com>
???????:fe*************************@posting.google .com...
Hello all,

I am trying to read in all the output from netstat.exe into my
program. While I have been successfull in doing so, I have some issues
that I cannot solve. I don't want the black window to show up, I want
it run in the background. The black window doesn't show anything in it
as I've already redirected the output to a stream. In any case, here
is my code:

Process process = new Process();
process.StartInfo.FileName = "netstat.exe";
process.StartInfo.Arguments = "-a -p TCP -b";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;

// start the process
process.Start();

I have fooled around with the StartInfo.WindowStyle and set it to
hidden, but it doesn't seem to do anything. I have also tried
Minimized and Maximized and they don't do anything either. Has anybody
figured out a way of doing this? Maybe Process isn't the right class
to use?

Any suggestions would be welcomed.

Thanks

Nov 16 '05 #2
I tried this as well and it also doesn't seem to do anything. If I
change my app to launch say notepad.exe all of these commands work
properly. I can CreateNoWindow and change the WindowStyle.

Any other suggestions?

Thanks
Zamil

"X-Killer" <X-******@netscape.net> wrote in message news:<ud**************@tk2msftngp13.phx.gbl>...
Hi Zamil,

Scroll up a little bit in the Intellisense and you'll find the
StartInfo.CreateNoWindow property.

Cheers.

"Zamil" <zm****@hotmail.com>
???????:fe*************************@posting.google .com...
Hello all,

I am trying to read in all the output from netstat.exe into my
program. While I have been successfull in doing so, I have some issues
that I cannot solve. I don't want the black window to show up, I want
it run in the background. The black window doesn't show anything in it
as I've already redirected the output to a stream. In any case, here
is my code:

Process process = new Process();
process.StartInfo.FileName = "netstat.exe";
process.StartInfo.Arguments = "-a -p TCP -b";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;

// start the process
process.Start();

I have fooled around with the StartInfo.WindowStyle and set it to
hidden, but it doesn't seem to do anything. I have also tried
Minimized and Maximized and they don't do anything either. Has anybody
figured out a way of doing this? Maybe Process isn't the right class
to use?

Any suggestions would be welcomed.

Thanks

Nov 16 '05 #3
Just to inform you that I had created the exact winform program and it
simply runs as expected without showing any dos windows.

"Zamil" <zm****@hotmail.com>
:fe**************************@posting.google.com.. .
I tried this as well and it also doesn't seem to do anything. If I
change my app to launch say notepad.exe all of these commands work
properly. I can CreateNoWindow and change the WindowStyle.

Any other suggestions?

Thanks
Zamil

"X-Killer" <X-******@netscape.net> wrote in message
news:<ud**************@tk2msftngp13.phx.gbl>...
Hi Zamil,

Scroll up a little bit in the Intellisense and you'll find the
StartInfo.CreateNoWindow property.

Cheers.

"Zamil" <zm****@hotmail.com>
???????:fe*************************@posting.google .com...
> Hello all,
>
> I am trying to read in all the output from netstat.exe into my
> program. While I have been successfull in doing so, I have some issues
> that I cannot solve. I don't want the black window to show up, I want
> it run in the background. The black window doesn't show anything in it
> as I've already redirected the output to a stream. In any case, here
> is my code:
>
> Process process = new Process();
> process.StartInfo.FileName = "netstat.exe";
> process.StartInfo.Arguments = "-a -p TCP -b";
> process.StartInfo.UseShellExecute = false;
> process.StartInfo.RedirectStandardOutput = true;
>
> // start the process
> process.Start();
>
>
>
> I have fooled around with the StartInfo.WindowStyle and set it to
> hidden, but it doesn't seem to do anything. I have also tried
> Minimized and Maximized and they don't do anything either. Has anybody
> figured out a way of doing this? Maybe Process isn't the right class
> to use?
>
> Any suggestions would be welcomed.
>
> Thanks

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1840
by: Kim Ipsen | last post by:
Hi. I don't know if this possible but how would you do it if you wanted to send commands til the comman prompt (and preferrably also receive the output from the command prompt - though not...
1
343
by: Stephen Woolhead | last post by:
Anyone know where I can get a command prompt control? Something like the command window in visual studion that I can add my own commands? Thanks Stephen.
1
2712
by: Mullin Yu | last post by:
But, I want is that I can have a Main app that will start a new process or kill one particular or all process. The process will open a console exe. But, I don't want the user to close the console...
1
9781
by: Primera | last post by:
I have an application that fixes some common problems that prevent the SMS Advanced Client from operating correctly. During this application I need to stop the Windows Management Instrumentation...
6
39476
by: Shooter4Life8 | last post by:
Hi, I am having trouble figureing out the best way to open a command prompt then write lines to it in VB.NET. Currently I have this code, but it execute's too fast I think because Dim psi As...
2
1567
by: srcleveland | last post by:
I am trying to have a windows service stop itself. I am currently using the following code but I would like to find a way to stop the service without having to shell out to a command prompt ...
3
6466
by: =?Utf-8?B?S3VlaXNoaW9uZyBUdQ==?= | last post by:
I have a .NET VC++ program, I want to execute some dos command from the program, e.g. copy some file, and etc. How do I do that?
3
5095
by: kimiraikkonen | last post by:
Hi experts, I just want to ask a simple procedure of my simple form. My form has a input textbox and a button. I want this if you can help me: Application user types a command prompt command...
4
2520
by: bkamrani | last post by:
Hi, This is a basic problem, but I want to print help content in a Command Prompt in WinXP and scrolling back to see the first lines. If I start a command prompt and run python, and then for...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.