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
LVL 11
bsharathAsked:
Who is Participating?
 
basicinstinctCommented:
double up your backslashes to escape them:

objShell.run ("\\\\in-ict-dsm\\Chennai_FS\\eDocPrintPro_Setup.exe /S");
0
 
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.