Lancer une aplication en html
Résolu
Bonjour, je souhaite lancer un programme par l'intermediaire d'une page html.
J'avais déja testé avec une autre application qui marchait, voici le code de celle qui marchait:
____________________________________
<head>
<script language="JavaScript" type="text/javascript">
<!--
function execAppli(app)
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run(app+".exe", 1, true);
}
-->
</script>
</head>
<body><center>
<form>
<input type="button" value="bloc note" onclick="execAppli('notepad')">
<input type="button" value="explorer" onclick="execAppli('explorer')">
</form>
</body>
___________________________________________________________________
et celui a moi ^^
qui ne marche pas :
<head>
<script language="JavaScript" type="text/javascript">
<!--
function execAppli(app)
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run(app+".exe", 1, true);
}
-->
</script>
</head>
<body><center>
<form>
<input type="button" value="eteindre" onclick="execAppli('shutdown.exe -s -f -t 0')">
<input type="button" value="redemarrer" onclick="execAppli('shutdown.exe -r -f -t 0')">
</form>
</body>
_____________________________________________
je ne voit pas ce qui cloche
quelqu'un pourrait m'aider
HELP...
Merci
J'avais déja testé avec une autre application qui marchait, voici le code de celle qui marchait:
____________________________________
<head>
<script language="JavaScript" type="text/javascript">
<!--
function execAppli(app)
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run(app+".exe", 1, true);
}
-->
</script>
</head>
<body><center>
<form>
<input type="button" value="bloc note" onclick="execAppli('notepad')">
<input type="button" value="explorer" onclick="execAppli('explorer')">
</form>
</body>
___________________________________________________________________
et celui a moi ^^
qui ne marche pas :
<head>
<script language="JavaScript" type="text/javascript">
<!--
function execAppli(app)
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run(app+".exe", 1, true);
}
-->
</script>
</head>
<body><center>
<form>
<input type="button" value="eteindre" onclick="execAppli('shutdown.exe -s -f -t 0')">
<input type="button" value="redemarrer" onclick="execAppli('shutdown.exe -r -f -t 0')">
</form>
</body>
_____________________________________________
je ne voit pas ce qui cloche
quelqu'un pourrait m'aider
HELP...
Merci
Configuration: Windows XP Internet Explorer 7.0
13 réponses
-
Contributeurrolala…
<head> <script language="JavaScript" type="text/javascript"> <!-- function execAppli(app) { var wshShell = new ActiveXObject("WScript.Shell"); wshShell.Run(app, 1, true); } --> </script> </head> <body><center> <form> <input type="button" value="eteindre" onclick="execAppli('shutdown.exe -s -f -t 0')"> <input type="button" value="redemarrer" onclick="execAppli('shutdown.exe -r -f -t 0')"> </form> </body>