8 Replies Latest reply on Jun 19, 2008 9:58 PM by roshan_thomas_mathew

    Run Batch File From Air Application

    Ben-MS
      Hi There

      I like to know if anyone attempted to run a batch file from Air Application.

      I have created a sample Air Application with HTML that when clicked on the button should execute a batch file.

      I have pasted the code below, Any Help Appreciated.


      ===========================

      <html xmlns="http:/www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Run This Batch File</title>
      <style type="text/css">
      <!--
      body {
      background-color: #999999;
      }
      -->
      </style>
      <script type="text/javascript">
      function runApp(which) {
      WshShell = new ActiveXObject("WScript.Shell");
      WshShell.Run (which,1,false);
      }
      </script>
      </head>

      <body leftmargin="0" topmargin="0">
      <table width="200" border="0" cellpadding="0" cellspacing="0">
      <tr>
      <td width="66" height="20"> </td>
      <td width="66"> </td>
      <td width="68"> </td>
      </tr>

      <tr>
      <td> </td>
      <td align="center"><img src="Icon1.gif" width="30" height="30" border="0" onClick="runApp('file://RunMe.bat');" /></td>
      <td> </td>
      </tr>
      <tr>
      <td height="20"> </td>
      <td> </td>
      <td> </td>
      </tr>
      </table>
      </body>
      </html>

      ===========================

      Thanks

      Ben