Fehlermeldung und keine Ahnung

crazytom

Grünschnabel
Ich habe einen Source in ASP.NET C#
welcher eine *.bat datei aufrufen soll soweit so gut.. habe auf meinem Rechner (winXP proffessional) das ding auch zum laufen gebracht geht also super.. jetzt der hacken. Wenn ich es auf unserem webserver (windows 2003 server und IIS 6.0) versuche bekomme ich eine fehlermeldung:

Der Zugriff auf den Pfad C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\3ed6e176\4613afa5 wurde verweigert.

Hat das was mit rechten zu tun? ich geh noch krachen bitte helft mir das muss dringesnt laufen :(

vielleicht hier mal noch ther code:

Code:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%
// Get the full file path
string strFilePath = "c:\\tool\\tbb.bat";

// Create the ProcessInfo object
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("cmd.exe");
psi.UseShellExecute = false; 
psi.RedirectStandardOutput = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardError = true;
psi.WorkingDirectory = "c:\\tool\\";

// Start the process
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);


// Open the batch file for reading
System.IO.StreamReader strm = System.IO.File.OpenText(strFilePath); 

// Attach the output for reading
System.IO.StreamReader sOut = proc.StandardOutput;

// Attach the in for writing
System.IO.StreamWriter sIn = proc.StandardInput;


// Write each line of the batch file to standard input
while(strm.Peek() != -1)
{
  sIn.WriteLine(strm.ReadLine());
}

strm.Close();

// Exit CMD.EXE
string stEchoFmt = "# {0} run successfully. Exiting";

sIn.WriteLine(String.Format(stEchoFmt, strFilePath));
sIn.WriteLine("EXIT");

// Close the process
proc.Close();

// Read the sOut to a string.
string results = sOut.ReadToEnd().Trim();


// Close the io Streams;
sIn.Close(); 
sOut.Close();


// Write out the results.
string fmtStdOut = "<font face=courier size=0>{0}</font>";
this.Response.Write(String.Format(fmtStdOut,results.Replace(System.Environment.NewLine, "<br>")));
%>
 
Dein ASPWorker Prozess Benutzer benötigt die entsprechenden Dateizugriffsrechte auf die Datei bzw. das Verzeichnis der Batchdatei.
 
Zuletzt bearbeitet:

Neue Beiträge

Zurück