Thursday, 12 September 2013

Access is denied when trying to open an exe application from a website

Access is denied when trying to open an exe application from a website

In my website, I tried to open a windows application (.exe) upon a button
click. But it showing "Access is denied".
Stack trace:
[Win32Exception (0x80004005): Access is denied]
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo) +614
System.Diagnostics.Process.Start() +56
ghs.btnTry_Click(Object sender, EventArgs e) in
c:\inetpub\vhosts\ddrivestudio.com\httpdocs\tanishq\ghs.aspx.cs:19
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+1565
Button click event:
Process p = new Process();
p.StartInfo.FileName = Request.MapPath("~/App/App1.exe");
p.Start();

No comments:

Post a Comment