PC Review


Reply
Thread Tools Rate Thread

Command line calling from Windows form

 
 
Z K
Guest
Posts: n/a
 
      20th May 2011
Hi

I am trying to issue some basic dos commands from insirde of my Form
on a button click. I can get a cmd window opoen but can't seem to
write to it. Can anyone help? Here is my code.

thanks

Zenon

String commandLine = @"c:\";
System.Diagnostics.ProcessStartInfo PSI = new
System.Diagnostics.ProcessStartInfo("cmd.exe");


PSI.RedirectStandardInput = true;
PSI.RedirectStandardOutput = true;
PSI.RedirectStandardError = true;

PSI.UseShellExecute = false;
System.Diagnostics.Process p =
System.Diagnostics.Process.Start(PSI);



System.IO.StreamWriter SW = p.StandardInput;
System.IO.StreamReader SR = p.StandardOutput;
SW.WriteLine("Hi");
//SW.Close();
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command line interface and Windows form in same program Jwe Microsoft VB .NET 10 13th Sep 2011 07:40 PM
Calling a specific Contact from command line parameter Rob Microsoft Outlook Contacts 1 26th Mar 2008 08:03 AM
Deployment for calling a command line exe dover@world.std.com Microsoft ASP .NET 1 12th Mar 2008 05:11 AM
onpostback: calling command-line programs? matt@mailinator.com Microsoft ASP .NET 8 26th Jul 2006 03:08 PM
Calling a command line =?Utf-8?B?S2Vu?= Microsoft Access Form Coding 1 29th Jun 2006 01:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:53 PM.