[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBScript to run application on local machine via HTA

Posted on 2008-11-07
3
Medium Priority
?
2,802 Views
Last Modified: 2012-08-13
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

0
Comment
Question by:jhrad
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 22914958
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
 

Author Closing Comment

by:jhrad
ID: 31514486
Thank you.  I had a feeling it was something silly like that.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22926076
No problem. Thanks for the grade.

Regards,

Rob.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question