By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,335 Members | 1,385 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,335 IT Pros & Developers. It's quick & easy.

process failure or cmd not running

P: n/a
Hi,
I have a method that uses a process and takes the output of the
process to append it to an existing file; however when I do
standardoutput.ReadToEnd() it doesn't get anything.
Here's what the actual code looks like:

private void CreateGridMapM(){
string programName2 = "psxy.exe";

string arg2 = @" -R -Jq -O
c:\inetpub\wwwroot\temp\gravitydata.dat -G0/255/255 -Sc0.05c >>
c:\inetpub\wwwroot\temp\test.ps";

ProcessStartInfo pInfo2 = new ProcessStartInfo();

pInfo2.FileName = programName2;
pInfo2.Arguments = arg2;
pInfo2.RedirectStandardOutput = true;
pInfo2.UseShellExecute = false;

//Start process psxy

Process p2 = Process.Start(pInfo2);
string output2 = p2.StandardOutput.ReadToEnd();

p2.WaitForExit();

FileStream fs2 = new
FileStream(@"c:\inetpub\wwwroot\temp\testing.ps",F ileMode.Append,
FileAccess.Write);
StreamWriter w2 = new StreamWriter(fs2);

w2.Write(output2);
w2.Close();
fs2.Close();

}

******************

I think the problem might be on the OS running this specific process,
if anyone can help I'd appreciate thanks in advance.

Jorge

PS when I run the command throught the cmd prompt it works fine...
Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.