We\'re developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed. We can\'t have any \"Would you
If you want to run application that you already have on the computer, you can do it via registering to the registry and them call it in HTML like you send email (mailto).
So, you just need to create registry:
using Microsoft.Win32;
using System;
using System.IO;
using System.Linq;
namespace WMConsole
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Listening..");
//Gets the current location where the file is downloaded
var loc = System.Reflection.Assembly.GetExecutingAssembly().Location;
if (!Directory.Exists(@"D:\Console\"))
{
System.IO.Directory.CreateDirectory(@"D:\Console\");
}
//Creates the Downloaded file in the specified folder
if (!File.Exists(@"D:\Console\" + loc.Split('\\').Last()))
{
File.Move(loc, @"D:\Console\" + loc.Split('\\').Last());
}
var KeyTest = Registry.CurrentUser.OpenSubKey("Software", true).OpenSubKey("Classes", true);
RegistryKey key = KeyTest.CreateSubKey("alert");
key.SetValue("URL Protocol", "wnPing");
key.CreateSubKey(@"shell\open\command").SetValue("", @"D:\Console\WMConsole.exe %1");
}
}
}
And then you can call it in HTML via:
Click to trigger
Here is the full article about it: https://www.codeproject.com/Articles/1168356/Run-an-EXE-from-Web-Application