469,921 Members | 2,198 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

Access denied when executing Process.Start() on my Server 2003

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.cm d";
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(NetGuar d_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.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277


Thanks in advance for all responses !

Cédric
Nov 18 '05 #1
2 17756
Try going into the .Net framework configuration permission set to "Full
Access" on the Runtime Security Policy --> Machine --> Code Groups -->
All_Code --> Internet Zone. By default, the "security" permission set that
is applied to the internet zone does not allow calls to unmanaged code.

You can acess this by going to Administrative tools and .Net framework
configuration V1.1

Also ensure that the impersonated user or group has access to the respective
files and directories.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Cédric Rossé" <ce**********@eiaj.ch> wrote in message
news:Or*************@TK2MSFTNGP11.phx.gbl...
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.cm d";
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(NetGuar d_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.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277


Thanks in advance for all responses !

Cédric

Nov 18 '05 #2
Humm...

Just try going through the following link i am sure your problem will get
resolved after this:
"http://support.microsoft.com/default.aspx?scid=kb;en-us;842789"

Best of luck!
-Hitesh Jain

"Cédric Rossé" wrote:
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.cm d";
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(NetGuar d_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.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277


Thanks in advance for all responses !

Cédric

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by access denied response | last post: by
reply views Thread by Anton Sokolovsky | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.