Ouvrir un exe en javascript
Bjr, j'ai un portail à réaliser en localhost sur un serveur apache et je doit pouvoir ouvrir Notepad à partir d'un lien.
J'ai trouvé différentes fonctions sur le net mais aucunes ne fonctionnent notamment celle-ci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <HTML>
<HEAD>
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function executeCommands()
{
// Instantiate the Shell object and invoke
its execute method.
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\WINDOWS\\Notepad.exe";
/* if (inputparms != "")
{
var commandParms = document.Form1.filename.value;
}*/
// Invoke the execute method.
oShell.ShellExecute(commandtoRun, "",
"", "open", "1");
}
</SCRIPT>
</HEAD>
<BODY>
<FORM name="Form1">
<CENTER>
<BR><BR>
<H1>Execute PC Commands From HTML </H1>
<BR><BR>
<File Name to Open:> <Input type="text"
name="filename"/>
<BR><BR>
<input type="Button" name="Button1" value="Run Notepad.exe" onClick="executeCommands()"/>
<BR><BR>
</CENTER>
</BODY>
</FORM>
</HTML> |
j'ai une erreur au niveau de la définition du bouton et il me dit "objet attendu"
avez-vous une idée pk ça cloche??? ou sinon si vous avez une autre fonction qui marche