Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: array type at runtime Pin
thepersonof31-May-06 9:00
thepersonof31-May-06 9:00 
QuestionOutlook Add-In Pin
Malik Nasir28-May-06 23:51
Malik Nasir28-May-06 23:51 
Questionopening a .doc or .pdf file in richtextbox in C# Pin
AnurRS28-May-06 22:48
AnurRS28-May-06 22:48 
QuestionForLoop & Foreach Pin
SysJey28-May-06 22:30
SysJey28-May-06 22:30 
AnswerRe: ForLoop & Foreach [modified] Pin
Colin Angus Mackay28-May-06 22:34
Colin Angus Mackay28-May-06 22:34 
GeneralRe: ForLoop & Foreach Pin
S. Senthil Kumar29-May-06 1:37
S. Senthil Kumar29-May-06 1:37 
GeneralRe: ForLoop & Foreach Pin
Colin Angus Mackay29-May-06 4:41
Colin Angus Mackay29-May-06 4:41 
QuestionCmd prompt Pin
Support12328-May-06 22:26
Support12328-May-06 22:26 
Hi all,

How do i send more than one command to command prompt through C#. I know how to send one command at a time but i need to send two. One needs to change my current directory path from: c:\Documents and settings to: c:\program files\progressive projects\progress\reports\reporttemplates here i need to run a batch file but this part i know...

ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = "/C " + command;
// redirect messages to this program
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
//don't execute using shellexecute API
startInfo.UseShellExecute = false;
//Don't open command prompt window
startInfo.CreateNoWindow = true;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
shellControl1.WriteText(output);
else if (error.Length != 0)
shellControl1.WriteText(error);

thank you in advanceBig Grin | :-D

He who laughs last...
AnswerRe: Cmd prompt Pin
Colin Angus Mackay28-May-06 22:31
Colin Angus Mackay28-May-06 22:31 
GeneralRe: Cmd prompt Pin
Support12328-May-06 22:35
Support12328-May-06 22:35 
GeneralRe: Cmd prompt Pin
Colin Angus Mackay28-May-06 22:40
Colin Angus Mackay28-May-06 22:40 
GeneralRe: Cmd prompt Pin
Support12328-May-06 22:45
Support12328-May-06 22:45 
Questionproblem with dataview Pin
foysal mamun28-May-06 22:25
foysal mamun28-May-06 22:25 
AnswerRe: problem with dataview [modified] Pin
rah_sin28-May-06 23:20
professionalrah_sin28-May-06 23:20 
GeneralRe: problem with dataview [modified] Pin
foysal mamun28-May-06 23:43
foysal mamun28-May-06 23:43 
QuestionHow to convert a file with extension .msg to .txt [modified] Pin
alokjha_mahe28-May-06 22:21
alokjha_mahe28-May-06 22:21 
AnswerRe: How to convert a file with extension .msg to .txt [modified] Pin
stancrm28-May-06 22:30
stancrm28-May-06 22:30 
AnswerRe: How to convert a file with extension .msg to .txt [modified] Pin
leppie29-May-06 4:35
leppie29-May-06 4:35 
Questiona question about date calculation ? Pin
cmpeng3428-May-06 22:09
cmpeng3428-May-06 22:09 
AnswerRe: a question about date calculation ? Pin
rah_sin28-May-06 22:26
professionalrah_sin28-May-06 22:26 
AnswerRe: a question about date calculation ? Pin
stancrm28-May-06 22:28
stancrm28-May-06 22:28 
AnswerRe: a question about date calculation ? Pin
foysal mamun28-May-06 22:32
foysal mamun28-May-06 22:32 
QuestionListview DragDrop Visual Themes error... Pin
Leon van Wyk28-May-06 22:08
professionalLeon van Wyk28-May-06 22:08 
QuestionSqlParameter Array ? Pin
Mairaaj Khan28-May-06 21:28
professionalMairaaj Khan28-May-06 21:28 
AnswerRe: SqlParameter Array ? Pin
albCode28-May-06 21:31
albCode28-May-06 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.