.NET & the command prompt

K

Kim Ipsen

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 necessary!) ?

I need to send a number of commands to the command prompt
and I can't really use the System.Diagnostics.Process
class.

Kim Ipsen
 
M

Michael Giagnocavo [MVP]

Why can't you use Process? You can redirect the standard input, output and
error, so you can read/write to the process. Can you give us an example of
what you want to do and why it's not working?
-mike
MVP
 
T

Tian Min Huang

Hi Kim,

Mike is correct that you can redirect the input/output in ProcessStartInfo.
Please refer to the following sample for detailed information:

Redirecting Standard Input/Output using the Process Class
http://www.c-sharpcorner.com/References/System.Diagnostic.Process.asp

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top