Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 29, 2012 02:07 PM by bbcompent1
Jun 27, 2012 10:49 AM|LINK
This is my code to call a .exe file in C# Web page.
System.Diagnostics.Process process1 = new System.Diagnostics.Process();
process1.StartInfo.WorkingDirectory = "W:\\inetpub\\wwwroot\\abc\\Xyx\\";
process1.StartInfo.FileName = "FileName.exe";
Whenever i call this code it gives me following error
Message: Access is denied
StackTrace: at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
Please help me to get out from this. My need here is simple i want to call a .exe file through web page.
Thanks in advance
Jun 27, 2012 10:58 AM|LINK
You have to be using an account that has admin privileges in the app pool identity.
Jun 27, 2012 11:20 AM|LINK
Any related expamle for this
Jun 27, 2012 11:21 AM|LINK
See this MS link:
Specify an Identity for an Application Pool (IIS 7)
Jun 27, 2012 02:28 PM|LINK
When do you get that error? After hosting in IIS or when debuggin with Visual Studio. If it occurs after hosting in IIS, try by giving the execute permission to
ISUR for that particular program. If it occurs while debugging with VS, try by giving execute permission to ASPNET for that particular program. Following link will help you with that. See the animation.
Following link will help you too
Please 'Mark as Answer' if this post helps you.
Jun 28, 2012 05:24 AM|LINK
I have given the permission to iUSR but still it is showing access is denied :(
Jun 28, 2012 07:08 AM|LINK
Just out of curiosity, you do realise that you cannot display this .exe or process to the user in asp.net dont you?
If this code successfully executed, all that would happen is that the process or executable would run or open on the iis server and would
not be displayed to the user.
Jun 28, 2012 12:50 PM|LINK
I don't want to display anything to user. i just to execute one process that is in .exe after some operation.
Jun 28, 2012 01:39 PM|LINK
Does this .exe live inside your web site?
Jun 28, 2012 01:40 PM|LINK
You said you gave permission to IUSR, that won't work. The account that is running the process has to be some other account. IUSR is set that way for security reasons. Have you tried setting the app pool identity to some local process account?