IIS - executing an external application
-
Hi, I am building an ASP.NET(2) app and am using IIS(6) on W2K3. In one of my pages I need to call an external executable (pass it some arguments and get the result back). But when I run the webapp, the program doesn't execute. On debugging it says "Access not allowed". I doubt it's not ASP.Net issue rather an IIS issue but am not sure. I tried almost every thing I could find through Google but no good. Any help in this regard would be highly appericiated. Here is the code I wrote:
Process proc = new Process(); string file = @"Bin\kuma.exe"; proc.StartInfo.FileName = file; proc.StartInfo.Arguments = "arg1 arg2 arg3"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardInput = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.CreateNoWindow = true; proc.Start(); /* Read proc output ... */ StreamReader output = proc.StandardOutput; string txt = output.ReadToEnd(); Trace.Write("txt" + txt);
Thanks and regards. -
Hi, I am building an ASP.NET(2) app and am using IIS(6) on W2K3. In one of my pages I need to call an external executable (pass it some arguments and get the result back). But when I run the webapp, the program doesn't execute. On debugging it says "Access not allowed". I doubt it's not ASP.Net issue rather an IIS issue but am not sure. I tried almost every thing I could find through Google but no good. Any help in this regard would be highly appericiated. Here is the code I wrote:
Process proc = new Process(); string file = @"Bin\kuma.exe"; proc.StartInfo.FileName = file; proc.StartInfo.Arguments = "arg1 arg2 arg3"; proc.StartInfo.UseShellExecute = false; proc.StartInfo.RedirectStandardInput = false; proc.StartInfo.RedirectStandardOutput = true; proc.StartInfo.CreateNoWindow = true; proc.Start(); /* Read proc output ... */ StreamReader output = proc.StandardOutput; string txt = output.ReadToEnd(); Trace.Write("txt" + txt);
Thanks and regards.You must give permission to the process that is running the website such as IUSR_ to the location of the executable. Cleako
-
You must give permission to the process that is running the website such as IUSR_ to the location of the executable. Cleako
-
Hi, I have already tried this. Also I have allowed "all unkonwn cgi extensions" in web services extensions tab in IIS manager but to no avail.
Did you ever get this solved? I have an ASP.NET that needs to create some files on the server, then zip them up and send them to the client. Do you have any suggestions? Thank you
Tom
-
Did you ever get this solved? I have an ASP.NET that needs to create some files on the server, then zip them up and send them to the client. Do you have any suggestions? Thank you
Tom
Yes. It was a long time ago but I think the issue was in fact regarding the execute permissions. After giving the network service account execute permission on the exe, it worked fine. I am not sure about your particular case. You can enable gzip compression in IIS or if you specifically want to send .zip archive, you can use some command line tool like rar. HTH, Aaron.