I have a simple powershell script, like this:
Write-Output "Hello"
saved on local disk C: and I would like to call it from a web page (https://mysite/page.html).
I tried several solutions, all these DON’T WORKS:
<button onclick="window.open('file:///C:/myprogram.exe')">
<input type="button" onclick="window.open('file:///C:/myprogram.exe')" />
<script type="text/javascript">
function RunExeFile(){
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("C:myprogram.exe", 1, false);
}
</script>
<a href="javascript:void(0);" onclick="RunExeFile()">run exe</a>
I also tried using Werbrun ( https://www.webrunapps.com/ ) with the following procedure:
- I created an exe with PS2EXE (.PS1 to .EXE)
- I added the following tag to in the html page
<a href="webrun:C:myprogram.exe">Run exe with Webrun</a>
but I get the following error:
“It seems that C:myprogram.exe is not a valid executable. Please check your syntax.”
PS. By launching the exe locally it works fine
Thanks.