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

C#

 
AnswerRe: Memory allocation help [modified] Pin
Guffa29-May-06 3:31
Guffa29-May-06 3:31 
GeneralRe: Memory allocation help [modified] Pin
eric_tran29-May-06 3:44
eric_tran29-May-06 3:44 
AnswerRe: Memory allocation help [modified] Pin
Guffa29-May-06 5:17
Guffa29-May-06 5:17 
GeneralRe: Memory allocation help [modified] Pin
eric_tran29-May-06 5:24
eric_tran29-May-06 5:24 
GeneralRe: Memory allocation help Pin
S. Senthil Kumar29-May-06 19:39
S. Senthil Kumar29-May-06 19:39 
GeneralRe: Memory allocation help Pin
Guffa29-May-06 22:49
Guffa29-May-06 22:49 
GeneralRe: Memory allocation help Pin
S. Senthil Kumar30-May-06 1:12
S. Senthil Kumar30-May-06 1:12 
Questioncommad Promt problem[modified] Pin
Support12329-May-06 1:05
Support12329-May-06 1:05 
its me again.

im still trying to send two commands to command prompt from c#. no luck yet.
the first command needs to change the current directory path to: c:\Program files\progressive projects\progress\reporttemplates
the second command needs to run a batch file inside this directory called fop.bat

my most recent attempt is....

string command=@"\\fop.bat -xml " + "\\ClientReportCard.xml " + "-xsl " + "\\" + Convert.ToString(TempName) + ".xsl " + "-pdf " + Convert.ToString(Salon.Library.GlobalVariables.Reports_Path) + "\\ClientRecordCard.pdf";

ProcessStartInfo startInfo = new ProcessStartInfo("cmd.exe");
// /c switch sends a command
startInfo.Arguments = "/C " + @"cd" + Convert.ToString(TempPath);
// 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 = false;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(startInfo);
startInfo.Arguments = "/C " + command;
startInfo.RedirectStandardError = true;
startInfo.RedirectStandardOutput = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = false;
System.Diagnostics.Process pp = System.Diagnostics.Process.Start(startInfo);
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
string output2 = pp.StandardOutput.ReadToEnd();
string error2 = pp.StandardError.ReadToEnd();
p.WaitForExit();
if (output.Length != 0)
shellControl1.WriteText(output);
else if (error.Length != 0)
shellControl1.WriteText(error);

BUT with this it executes the one command and forgets the directory path and then executes the second command. In this way it can't find the batch file. please help. iv been stugling with this on for days now.

He who laughs last...

-- modified at 7:23 Monday 29th May, 2006
AnswerRe: hi all Pin
Support12329-May-06 1:18
Support12329-May-06 1:18 
GeneralRe: hi all Pin
lmoelleb29-May-06 1:30
lmoelleb29-May-06 1:30 
GeneralRe: hi all Pin
Support12329-May-06 1:37
Support12329-May-06 1:37 
Questiona question about displaying time ? Pin
cmpeng3429-May-06 0:46
cmpeng3429-May-06 0:46 
AnswerRe: a question about displaying time ? [modified] Pin
rah_sin29-May-06 0:52
professionalrah_sin29-May-06 0:52 
QuestionVideo Preview in Fullscreen problem Pin
ranandbe29-May-06 0:36
ranandbe29-May-06 0:36 
Questionarray type at runtime Pin
thepersonof29-May-06 0:07
thepersonof29-May-06 0:07 
AnswerRe: array type at runtime Pin
S. Senthil Kumar29-May-06 0:13
S. Senthil Kumar29-May-06 0:13 
GeneralRe: array type at runtime [modified] Pin
thepersonof29-May-06 1:23
thepersonof29-May-06 1:23 
GeneralRe: array type at runtime Pin
S. Senthil Kumar29-May-06 19:41
S. Senthil Kumar29-May-06 19:41 
GeneralRe: array type at runtime Pin
thepersonof30-May-06 9:38
thepersonof30-May-06 9:38 
GeneralRe: array type at runtime Pin
S. Senthil Kumar30-May-06 19:20
S. Senthil Kumar30-May-06 19:20 
GeneralRe: array type at runtime Pin
thepersonof30-May-06 20:44
thepersonof30-May-06 20:44 
GeneralRe: array type at runtime Pin
S. Senthil Kumar31-May-06 7:14
S. Senthil Kumar31-May-06 7:14 
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 

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.