• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

Run an exe with /s in the Html file

Hi,

I have this file when run from run prompt works fine

\\Machine\Foldername\eDocPrintPro_Setup.exe /s

When i use like this.
Does not work
<html>
<body>
<a href= "\\machinename\foldername\eDocPrintPro_Setup.exe /s"> test link </a>
</body>
</html>

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 4
  • 3
1 Solution
 
basicinstinctCommented:
you can't do that.
you'll need to create an HTA application (just save your .html file with a .hta extension)...

Here's a vbscript example:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1031.mspx

converted to jscript:

<html>
<head>
<script language="Javascript">

    function RunProgram()
    {
        var objShell = new ActiveXObject("WScript.Shell");
        oShell.run ("notepad.exe c:\\scripts\\test.txt");
    }

</script>
</head>

<body>
<button onclick="RunProgram();">Run Program</button> <p>
</body>
</html>

0
 
bsharathAuthor Commented:
Can i use something like this...

<html>
<head>
<script language="Javascript">

    function RunProgram()
    {
        var objShell = new ActiveXObject("WScript.Shell");
        oShell.run ("notepad.exe \\dsm\FS\eDocPrintPro_Setup.exe /S");
    }

</script>
</head>

<body>
<button onclick="RunProgram();">Run Program</button> <p>
</body>
</html>

Or is there anything i need to change
0
 
basicinstinctCommented:
go to:

Start > Run

and type notepad.exe \\dsm\FS\eDocPrintPro_Setup.exe /S

If it works there it will work in your hta.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bsharathAuthor Commented:
Line 8 character 9 error
Line error 0shell is unidentified.

I get this message

0
 
basicinstinctCommented:
yeah, i had a type, sorry, try this:

<html>
<head>
<script language="Javascript">

    function RunProgram()
    {
        var objShell = new ActiveXObject("WScript.Shell");
        objShell.run ("notepad.exe c:\\scripts\\test.txt");
    }

</script>
</head>

<body>
<button onclick="RunProgram();">Run Program</button> <p>
</body>
</html>
0
 
bsharathAuthor Commented:
It says path cannot be specified...

I have this line

        objShell.run ("\\in-ict-dsm\Chennai_FS\eDocPrintPro_Setup.exe /S");

It works when put on run prompt but not in the code...
0
 
basicinstinctCommented:
double up your backslashes to escape them:

objShell.run ("\\\\in-ict-dsm\\Chennai_FS\\eDocPrintPro_Setup.exe /S");
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now