Hi All,
I have a strange requirement from a client that I have been battling with for weeks.
The client has a standalone exe and web applications sitting on Windows 2012 Server. The Plan is to incorporate the exe application into the Web applications so that it can be rendered through the browser or called via a hyperlink. The exe application is portable. Web applications run on .NET framework 3.5,written in C#.
Due to high security restrictions on the server none of my attempts seem to work. When I click on the button on the page nothing happens.
I am now exploring delivering the exe application to end users via WebDAV. Any ideas would be helpful.
What I have tried:
On web.config I sent the path.
<appSettings>
<add key="EXELOC" value="C:\Temp\addons\"/>
</appSettings>
On the aspx page I have a button that calls the application
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Diagnostics;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnStart_Click(object sender, EventArgs e)
{
string locn = ConfigurationManager.AppSettings["EXELOC"];
Process myProcess = new Process();
try
{
myProcess.StartInfo.UseShellExecute = True;
myProcess.StartInfo.FileName = locn + "Application.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
I have also attempted to utilize URI:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Ach]
@="URL:Ach Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\Ach\DefaultIcon]
@="C:\Temp\addons\\Application.exe"
[HKEY_CLASSES_ROOT\Ach\shell]
[HKEY_CLASSES_ROOT\Ach\shell\open]
[HKEY_CLASSES_ROOT\Ach\shell\open\command]
@="\"C:\\Temp\\addons\\Application.exe\" /u \"%1\""
I have also attempted setting the application UNC and calling via Javascript:
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("\\\\192.168.5.8\\Applications\\Application.bat", 1,false);
}
</script>