Firstly, I am aware that this question has been asked before (Is it possible to run an .exe or .bat file on 'onclick' in HTML) but I tried to do what was suggested and I could not make it work.
Here is my code:
<html>
<body>
<input type="button" value="Launch Installer" onclick="window.open(file:///S:downloads/thing.sh)” />
</body>
</html>
This code is in a file called "test.html" in my downloads folder.
I ran it in command line with this command
open test.html
and that resulted in google chrome opening a blank page.
Also, I have an shell script in my downloads folder named "thing.sh" containing this code:
echo hello world
Thanks for the help.
Using PHP (I've tried fixing my file path and it still doesn't work)
I tried what was suggested in the link provided by james111 (how to run a .sh file from php?) and this is my code:
<?php
echo shell_exec(‘Users/mathewlewis/downloads/thing.sh');
?>
I'm not sure how to run a php file from command line like I did with the html file (I have this code saved in a file called test.php) so I tried putting it in a file named test.html and that created a blank page in chrome like before.