frankx: Lokale Datei starten...

Beitrag lesen

Hellihello Stefan,

take that:

  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
 <head>  
  <title>Javascript Batchdatei</title>  
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  
 <script type="text/javascript">  
 //<![CDATA[  
 function Kommandozeile() {  
  wshShell = new ActiveXObject("WScript.Shell");  
  Kommando = 'cmd.exe /c "firefox.exe http://www.google.de"';  
  alert(Kommando);  
  wshShell.Exec(Kommando);  
 }  
 function Programm_mit_Parameter() {  
  wshShell = new ActiveXObject("WScript.Shell");  
  wshShell.Run("firefox.exe http://www.google.de");  
 }  
 function execSkript() {  
  var WshShell = new ActiveXObject("WScript.Shell");  
  var oExec = WshShell.Exec("dir /p");  
 }  
//]]>  
 </script>  
 <style type="text/css">  
  button {display:block};  
 </style>  
</head>  
 <body>  
  <input size="5" id="bisWann" />  
  <button onclick="Kommandozeile()">Kommandozeile()</button>  
  <button onclick="Programm_mit_Parameter()">Programm_mit_Parameter()</button>  
  <div id="infozeile"></div>  
 </body>  
</html>  
  
  

... in Javascript mit Parameterübergabe. Einmal direkt der Programmaufruf, einmal über die Kommandozeile.

Abgesehen davon, wer Programme aufrufen kann, kann auch Batchdateien aufrufen, meine ich.

Dank und Gruß,

frankx