Hello everyone
Could you tell me if it is possible to launch the execution of a program using the OnClick event? I would like to when I click a button that installs the program The program is located in a folder in local programs
Hello everyone
Could you tell me if it is possible to launch the execution of a program using the OnClick event? I would like to when I click a button that installs the program The program is located in a folder in local programs
Hello , You'll get a security warning but you can do it:
<html>
<head>
<title>run_exe.com/</title>
<script type="text/javascript">
function run(what) {
var wss = new ActiveXObject("WScript.Shell");
wss.Run(what);
}
</script>
</head>
<body>
<form>
<input type="button" value="Notepad" onclick="run('Notepad.exe')">
<input type="button" value="Calculator" onclick="run('Calc.exe')">
</form>
</body>
</html>
Hey , Check This Link it might Be helpful http://www.microsoft.com/technet/scr...5/hey1031.mspx
Your should use ShellExecute rather than execl. I think the exe* functions were designed for windows older than Windows 95. To use ShellExecute do
#include <shellapi.h>
ShellExecute(NULL, "open", "MyProgram", NULL, NULL, SW_SHOW);
The 3rd parameter is any command line arguments your program takes.
In javascript, it is not possible to launch the execution of commands or programs when it is played on a browser. This is for security reasons. As against it is quite possible to simulate the behavior of a link when you click on a button, here's an example:
Code:<html> <head> </ head> <body> <a href="./FileZilla_Server-0_9_25.exe"> click </ a> <input type="button" value="clic" onClick="window.location.href='./FileZilla_Server-0_9_25.exe';"> </ body> </ html>
When you click on the link or button your browser will offer you to run or download the executable.
Bookmarks