Hi!
Does anyone know why the code below always returns an "access is denied"
error?
private void Page_Load(object sender, System.EventArgs e)
{
System.Diagnostics.Process meProc = System.Diagnostics.Process.Start
("cmd.exe", " /c echo y| CACLS C:\\Temp /E /T /G test:F");
meProc.StartInfo.UseShellExecute = false;
meProc.StartInfo.CreateNoWindow = true;
meProc.StartInfo.RedirectStandardError = true;
meProc.StartInfo.RedirectStandardOutput = true;
meProc.Start();
string output = meProc.StandardError.ReadToEnd();
meProc.WaitForExit();
Response.Write (output);
}
I've specified that impersonation should be used in web.config (<identity
impersonate="true"/>) and I've specified that the anonymous user should be
"Administrator" on the virtual directory that I'm using for my web
application.
Help is appreciated.
Morten