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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Paul Glavich [MVP - ASP.NET] (glav_at_aspalliance.com-NOSPAM)
Date: 10/27/04


Date: Wed, 27 Oct 2004 21:39:22 +1000

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é" <cedric.rosse@eiaj.ch> wrote in message
news:Or6BBFAvEHA.908@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.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.RaisePo
stBackEvent(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
>
>

Quantcast