Question:

Executing exe on a network in HTML

by  |  earlier

0 LIKES UnLike

I want to execute an exe on the network in my html code. I can display images but not execute exe.

It gives an error "The system could not find the file specified". How can I achieve this? My code is pasted below. What am I doing wrong?

<html>

<head>

<script language="JavaScript" type="text/javascript">

MyObject = new ActiveXObject( "WScript.Shell" )

function RunEXE()

MyObject.Run("\\gnomedev\test.bat") ;

}

</script>

</head>

<body>

<h1><font color=red> Status of the migration </font></h1>

<img src=\\gnomedev\mig.jpg > <p>

<button onclick="RunEXE()">Get Status</button>

</body>

</html>

 Tags:

   Report

3 ANSWERS


  1. . Not the title bar of the HTA

    xmllover.hta

    &lt;html&gt;

    &lt;head&gt;

    &lt;title&gt; xmllover &lt;/ title&gt;

    &lt;hta:application caption=&quot;no&quot;&gt;

    &lt;/ head&gt;

    &lt;body&gt;

    &lt;center&gt;

    &lt;p&gt; Believe xmllover &lt;/ p&gt;

    &lt;/ center&gt;

    &lt;button onlick=&quot;self.close()&quot; style=&quot;font-size:18&quot;&gt; left &lt;/ button&gt;

    &lt;/ body&gt;

    &lt;/ html&gt;

    2. Icon to change the title of the document HTA

    Please make a ico icon into C: directory

    xmllover1.hta

    &lt;html&gt;

    &lt;head&gt;

    &lt;title&gt; xmllover &lt;/ title&gt;

    &lt;hta:application caption=&quot;yes&quot; icon=&quot;c:/xmllover.ico&quot;&gt;

    &lt;/ head&gt;

    &lt;body&gt;

    &lt;center&gt;

    &lt;p&gt; Believe xmllover &lt;/ p&gt;

    &lt;/ center&gt;

    &lt;button onclick=&quot;self.close()&quot; style=&quot;font-size:18&quot;&gt; left &lt;/ button&gt;

    &lt;/ body&gt;

    &lt;/ html&gt;

    http://www.Fix-pc-Master.com

    Good luck


  2. First, you&#039;re missing the opening curly brace to your JS function...

    Also, try not using a relative path. Instead use the whole path such as:

    file:///C:/Program%20Files/My%20Direct...

  3. 1. you are missing a curly bracket after the function RunEXE()

    2. you need to change the backslashes to forwards slashes

    3. you can ONLY run this from harddisc or by saving with extension .hta for obvious security reasons

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.