I am working on a kludge which is working locally but not after I deploy it to our server.
I have a web page which opens, runs an
EXEand then closes the web page. Locally this works but after publishing to the server theEXEdoes not run. I have confirmed that the file path works from the server.
My Web Page code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EmailSignature_EXEC.aspx.cs" Inherits="_Default" %>
<html>
<head>
<title></title>
<script>
function loaded()
{
window.setTimeout(CloseMe, 500);
}
function CloseMe()
{
window.open('', '_self').close();
}
</script>
<script type="text/javascript">
</script>
</head>
<body onLoad="loaded()">
Hello!
\\\\cmbfs02\\Software\\web\\EmailSignature_WPF\\EmailSignature_WPF.exe
</body>
</html>
C# Code:
using System.Diagnostics;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load()
{
var applicationPath = "\\\\cmbfs02\\Software\\web\\EmailSignature_WPF\\EmailSignature_WPF.exe";
Process.Start(applicationPath);
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Close", "window.close()", true);
}
}
When I browse to my page on IIS I see the page appear and close after the Timeout but the Application doesn't run. If I copy the EXE path into Windows Explorer the application runs, but it does not from the method. Any help appreciated
Process.Start- it is your web-server, and more specifically the IIS / app-pool service account. It doesn't have a desktop upon which to display a UI.