VBScript to run application on local machine via HTA

Hi All,

I'm trying to create an HTA app that will launch an application on a local machine.  I'm having problems, probably with syntax, getting the objShell.run part to work.

I can paset this part "C:\WINDOWS\system32\java.exe -jar "C:\Program Files\EDS\AvLaunch.jar" IMAGEVIEWER.JHMI.COM --type ARS --port 80  --protocol HTTP" into a Start --> Run dialogue and it works.

Thanks.


<html>
<head>
<title>UV Start</title>
 
<HTA:APPLICATION 
     ID="UVHTA"
     APPLICATIONNAME="UVHTA"
     SCROLL="no"
	 SCROLLFLAT="yes"
     SINGLEINSTANCE="yes"
	 icon="http://help.jhmi.com/favicon.ico" 
	 CAPTION="yes"
	 SysMenu="Yes"
	 ShowInTaskbar="yes"
	 BORDER="thin"
	 BORDERSTYLE="normal"
	 SELECTION = "yes"
	 maximizeButton="no"
	 minimizeButton="no"
	 WINDOWSTATE="normal" 
 
>
<SCRIPT LANGUAGE="VBScript">
 
    Sub Window_onLoad
	    window.moveTo 15,15
        window.resizeTo 300,250
    End Sub 
</script>
 
<SCRIPT LANGUAGE="VBScript">
Sub RunScript
	Set objShell = CreateObject("Wscript.Shell")
	objShell.Run "C:\WINDOWS\system32\java.exe -jar "C:\Program Files\EDS\AvLaunch.jar" IMAGEVIEWER.JHMI.COM --type ARS --port 80  --protocol HTTP"
End Sub
</script>
 
 
</head>
 
 
<body STYLE="font:14 pt arial; color:white;
 filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000000', EndColorStr='#0000FF')">
 
 <table width="100%" border=1>
  <tr>
    <td width="50%" valign="top"><input id=runbutton  class="button" type="button" value="Launch" name="run_button"  onClick="RunScript"></td>
    <td width="50%" valign="top">Name</td>
  </tr>
</table
 
</body>
</html>

Open in new window

jhradAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobSampsonCommented:
Hi, because you have extra quotes in your command string, you need to double them up to have them literally appear as part of the command.

In your command, you only to double the quotes around C:\Program Files\EDS\AvLaunch.jar

Regards,

Rob.
	objShell.Run "C:\WINDOWS\system32\java.exe -jar ""C:\Program Files\EDS\AvLaunch.jar"" IMAGEVIEWER.JHMI.COM --type ARS --port 80  --protocol HTTP"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jhradAuthor Commented:
Thank you.  I had a feeling it was something silly like that.
0
RobSampsonCommented:
No problem. Thanks for the grade.

Regards,

Rob.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.