.NET & the command prompt

  • Thread starter Thread starter Kim Ipsen
  • Start date Start date
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
 
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
 
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.
 
Back
Top