Lancer .js sous forme d'un activeX
Bonjour, voila ma question, peut on lancer un fichier.js sous la forme d'un activeX ?
Pourquoi ?, car IE ignore mon code en ligne (il affiche pas un pop-up demandant si oui ou non il veut exécuter ce contrôle activeX), en locale tout fonctionne en revanche.
Voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| function OuvreExecutable()
{
var w = new ActiveXObject("WScript.Shell");
var myObject;
myObject = new ActiveXObject("Scripting.FileSystemObject");
if(myObject.FileExists('c://windows/monprog/monprog.exe')){
w.run('%WINDIR%/monprog/monprog.exe');
} else {
lancertruc();
}
}
function lancertruc() {
var wScript = new ActiveXObject("Wscript.Shell" );
wScript.run("http://monsite/monprog.exe");
return false;
} |
Peut on aussi faire un try catch afin que si la personne n'éxecute mon activeX, il execute ce code :
document.writeln(" <META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=monprog.exe\"> ");