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 48 49 50 51 52 53
|
<html>
<!-- Date de création: 31/03/2006 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="Description" content="">
<meta name="Keywords" content="">
<meta name="Author" content="jcodeunpeu">
<meta name="Generator" content="WebExpert 2000">
</head>
<BODY><b><pre>
fichier <input type="file" name="fic" size=64><br>
<input value="avec classid"
type="button"
onclick='lancerclassid(fic.value);'> nom exécutable
<input value="avec start"
type="button"
onclick='lancerstart(fic.value);'> nom exécutable ou fichier ( lancera le programme associé,
celui utilisé par "Ouvrir avec" )
<input value="avec run"
type="button"
onclick='lancerrun(fic.value);'> nom d'un éxécutable uniquement si sous un répertoire accessible
directement par path ( windows,mes documents\util ... )
<input value="word sur *.doc"
type="button"
onclick="lancerword(fic.value);"> un fichier *.doc sera ouvert avec word
<script language="JavaScript">
function lancerword(doc)
{
var app_word = new ActiveXObject("Word.Application");
app_word.Application.Visible = true;
app_word.documents.open(doc); }
function lancerclassid(exe)
{var p = window.createPopup();
var b = p.document.body;
b.innerHTML = '<OBJECT CLASSID="CLSID:12345678-1234-1234-1234-123456789ABC"' +
' CODEBASE="'+exe+'"></OBJECT>';}
function lancerstart(exe)
{
window.alert(exe);
w = new ActiveXObject("WScript.Shell");
w.run ('start "'+exe+'"');
}
function lancerrun(exe)
{
var w = new ActiveXObject("WScript.Shell");
w.run (exe,1,true); }
</script>
</BODY></
</html> |