process StandardOutput Security Inquiry

S

shellyshao

Hi, I have an ASP.NET web application running with following code:
System.Diagnostics.Process runner = new System.Diagnostics.Process();


runner.StartInfo.FileName = "fc.exe";
runner.StartInfo.Arguments = strFile1 + " " + strFile2;


runner.StartInfo.WorkingDirectory = strFileRoot;
runner.StartInfo.UseShellExecute = false;
runner.StartInfo.RedirectStandardOutput = true;
runner.StartInfo.RedirectStandardError=true;
runner.Start();

StreamWriter sw = new StreamWriter(strFileRoot+
"\\diff.txt",false);
string strDiff = runner.StandardOutput.ReadToEnd();
thisPage.Trace.Write("running under:"+ Environment.UserName);
thisPage.Trace.Write("running
under:"+System.Security.Principal.WindowsIdentity.GetCurrent().Name);
thisPage.Trace.Write("fc.exe "+strFile1+"
"+strFile2+":"+strFileRoot+":"+runner.StandardError.ReadToEnd() +
":"+strDiff);
sw.Write(strDiff);
sw.Close();

runner.WaitForExit();
runner.Close();


It works fine on my windows XP + SP2 machine. However, on a windows
2003 server, strDiff is always empty and starndarderror is also empty.
I do notice it runs as aspnet on windows xp, but as network service
acount on 2003. So I impersonated to a domain account and also added
that domain account to admin groups on the windows 2003 machine, but
still strDiff returns empty. Please please please help.

Haiping
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top