C
Cédric Rossé
Hello,
I'm currently developping a web application and I'm trying to execute a
batch file (.cmd) on the server side when the client presses a button on a
web page.
When I do this on my local machine (where I'm developping my application),
no problem occurs. But when I put the web application on my Windows server
2003 server, I always get the following error message. Can someone help me ?
Here is the config of my webconfig file :
<authentication mode="Windows" />
<identity impersonate="true"/>
And Here is the section process model of my machine.config file:
<processModel enable="true" timeout="Infinite" idleTimeout="Infinite"
shutdownTimeout="0:00:05" requestLimit="Infinite" requestQueueLimit="5000"
restartQueueLimit="10" memoryLimit="60" webGarden="false"
cpuMask="0xffffffff" userName="SYSTEM" password="AutoGenerate"
logLevel="Errors" clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect" comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00" maxWorkerThreads="20"
maxIoThreads="20"/>
Server Error in '/NetGuard' Application.
--------------------------------------------------------------------------------
Access is denied
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: Access is denied
Source Error:
Line 63: myProcess.StartInfo.FileName =
"C:\\Inetpub\\wwwroot\\NetGuard\\CMD\\NetSH.cmd";
Line 64: myProcess.StartInfo.WorkingDirectory =
"C:\\Inetpub\\wwwroot\\NetGuard\\CMD";
Line 65: myProcess.Start();
Line 66:
Line 67: /*StreamReader sOut = myProcess.StandardOutput;
Source File: c:\inetpub\wwwroot\netguard\netguard_agent.cs Line: 65
Stack Trace:
[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo) +1106
System.Diagnostics.Process.Start() +85
NetGuard.Sys.NetGuard_Agent.ProcessCommand(NetGuard_Data _NetGuard_Data,
String _RoomName, String _RuleName) in
c:\inetpub\wwwroot\netguard\netguard_agent.cs:65
NetGuard.Generation.ScriptButton_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\NetGuard\Generation.aspx.cs:62
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Thanks in advance for all responses !
Cédric
I'm currently developping a web application and I'm trying to execute a
batch file (.cmd) on the server side when the client presses a button on a
web page.
When I do this on my local machine (where I'm developping my application),
no problem occurs. But when I put the web application on my Windows server
2003 server, I always get the following error message. Can someone help me ?
Here is the config of my webconfig file :
<authentication mode="Windows" />
<identity impersonate="true"/>
And Here is the section process model of my machine.config file:
<processModel enable="true" timeout="Infinite" idleTimeout="Infinite"
shutdownTimeout="0:00:05" requestLimit="Infinite" requestQueueLimit="5000"
restartQueueLimit="10" memoryLimit="60" webGarden="false"
cpuMask="0xffffffff" userName="SYSTEM" password="AutoGenerate"
logLevel="Errors" clientConnectedCheck="0:00:05"
comAuthenticationLevel="Connect" comImpersonationLevel="Impersonate"
responseDeadlockInterval="00:03:00" maxWorkerThreads="20"
maxIoThreads="20"/>
Server Error in '/NetGuard' Application.
--------------------------------------------------------------------------------
Access is denied
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: Access is denied
Source Error:
Line 63: myProcess.StartInfo.FileName =
"C:\\Inetpub\\wwwroot\\NetGuard\\CMD\\NetSH.cmd";
Line 64: myProcess.StartInfo.WorkingDirectory =
"C:\\Inetpub\\wwwroot\\NetGuard\\CMD";
Line 65: myProcess.Start();
Line 66:
Line 67: /*StreamReader sOut = myProcess.StandardOutput;
Source File: c:\inetpub\wwwroot\netguard\netguard_agent.cs Line: 65
Stack Trace:
[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo
startInfo) +1106
System.Diagnostics.Process.Start() +85
NetGuard.Sys.NetGuard_Agent.ProcessCommand(NetGuard_Data _NetGuard_Data,
String _RoomName, String _RuleName) in
c:\inetpub\wwwroot\netguard\netguard_agent.cs:65
NetGuard.Generation.ScriptButton_Click(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\NetGuard\Generation.aspx.cs:62
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Thanks in advance for all responses !
Cédric