launch script from a hta? 
Author Message
 launch script from a hta?

 Hello I am new to making hta apps and wanted to know if there was a way to
 launch a vbs script without getting a download dialog box?

 I have searched many webpages and the answer seems to have something to do
 with making the app "trusted".

 It was my understanding that hta's were already trusted but I can't seem
to make this work. Could somebody post an example of how this works.

 Thanks



Wed, 21 May 2003 03:00:00 GMT  
 launch script from a hta?



Quote:
> Hello I am new to making hta apps and wanted to know if there was a way to
>  launch a vbs script without getting a download dialog box?

>  I have searched many webpages and the answer seems to have something to
do
>  with making the app "trusted".

>  It was my understanding that hta's were already trusted but I can't seem
> to make this work. Could somebody post an example of how this works.

HTA's are no more "trusted" than any other application that has the
capability of taking complete control of the client machine. What the ARE,
though, is "trustING". An HTA can run any other application or script
without popping up the security-related dialogues you see when running a web
page.

/Al

Quote:
>  Thanks



Wed, 21 May 2003 03:00:00 GMT  
 launch script from a hta?
Don't launch the .vbs file from the href of an anchor tag. Create an
instance of WScript.Shell and Run the .vbs file...

<html>
<head><title>foobar</title>
<hta:application id="ohta">
<script language="VBScript">
sub foobar_onclick()
  with createobject("wscript.shell")
  .run "junk.vbs"
  end with
end sub
</script>
</head>
<body>
<a href="junk.vbs">junk</a>
<input id="foobar" type="button" value="junk">
</body>
</html>

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



Quote:
> Hello I am new to making hta apps and wanted to know if there was a way to
>  launch a vbs script without getting a download dialog box?

>  I have searched many webpages and the answer seems to have something to
do
>  with making the app "trusted".

>  It was my understanding that hta's were already trusted but I can't seem
> to make this work. Could somebody post an example of how this works.

>  Thanks



Wed, 21 May 2003 03:00:00 GMT  
 launch script from a hta?
Thank you for the help.


Quote:



> > Hello I am new to making hta apps and wanted to know if there was a way
to
> >  launch a vbs script without getting a download dialog box?

> >  I have searched many webpages and the answer seems to have something to
> do
> >  with making the app "trusted".

> >  It was my understanding that hta's were already trusted but I can't
seem
> > to make this work. Could somebody post an example of how this works.

> HTA's are no more "trusted" than any other application that has the
> capability of taking complete control of the client machine. What the ARE,
> though, is "trustING". An HTA can run any other application or script
> without popping up the security-related dialogues you see when running a
web
> page.

> /Al

> >  Thanks



Wed, 21 May 2003 03:00:00 GMT  
 launch script from a hta?
Thanks for the help.

I was trying href tags at first then switched to using VBScript and just now
got it down right.


Quote:
> Don't launch the .vbs file from the href of an anchor tag. Create an
> instance of WScript.Shell and Run the .vbs file...

> <html>
> <head><title>foobar</title>
> <hta:application id="ohta">
> <script language="VBscript">
> sub foobar_onclick()
>   with createobject("wscript.shell")
>   .run "junk.vbs"
>   end with
> end sub
> </script>
> </head>
> <body>
> <a href="junk.vbs">junk</a>
> <input id="foobar" type="button" value="junk">
> </body>
> </html>

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --



> > Hello I am new to making hta apps and wanted to know if there was a way
to
> >  launch a vbs script without getting a download dialog box?

> >  I have searched many webpages and the answer seems to have something to
> do
> >  with making the app "trusted".

> >  It was my understanding that hta's were already trusted but I can't
seem
> > to make this work. Could somebody post an example of how this works.

> >  Thanks



Wed, 21 May 2003 03:00:00 GMT  
 launch script from a hta?
It is also possible to launch from a hyperlink. This also
shows instantiating from <object> tag as well:

<html>
<head><title>foojslink</title>
<hta:application id="ohta">
<object id="wsh" classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
<script language="JScript">
function launch(){
  wsh.run("nowdate.vbs")
 }
</script>
</head>
<body>
<h1>Launch App via Link & JScript</h1>
 <a href="" onClick="wsh.run('nowdate.vbs');return false">Launch1</a>
 <a href="" onClick="launch();return false">Launch2</a>
 </body>
</html>

Quote:

> Don't launch the .vbs file from the href of an anchor tag. Create an
> instance of WScript.Shell and Run the .vbs file...

> <html>
> <head><title>foobar</title>
> <hta:application id="ohta">
> <script language="VBscript">
> sub foobar_onclick()
>   with createobject("wscript.shell")
>   .run "junk.vbs"
>   end with
> end sub
> </script>
> </head>
> <body>
> <a href="junk.vbs">junk</a>
> <input id="foobar" type="button" value="junk">
> </body>
> </html>

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --



> > Hello I am new to making hta apps and wanted to know if there was a way to
> >  launch a vbs script without getting a download dialog box?

> >  I have searched many webpages and the answer seems to have something to
> do
> >  with making the app "trusted".

> >  It was my understanding that hta's were already trusted but I can't seem
> > to make this work. Could somebody post an example of how this works.

> >  Thanks



Thu, 22 May 2003 03:00:00 GMT  
 launch script from a hta?
hey that looks cool.

I'll give it a try thanks


Quote:
> It is also possible to launch from a hyperlink. This also
> shows instantiating from <object> tag as well:

> <html>
> <head><title>foojslink</title>
> <hta:application id="ohta">
> <object id="wsh"

classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
Quote:
> <script language="JScript">
> function launch(){
>   wsh.run("nowdate.vbs")
>  }
> </script>
> </head>
> <body>
> <h1>Launch App via Link & JScript</h1>
>  <a href="" onClick="wsh.run('nowdate.vbs');return false">Launch1</a>
>  <a href="" onClick="launch();return false">Launch2</a>
>  </body>
> </html>


> > Don't launch the .vbs file from the href of an anchor tag. Create an
> > instance of WScript.Shell and Run the .vbs file...

> > <html>
> > <head><title>foobar</title>
> > <hta:application id="ohta">
> > <script language="VBscript">
> > sub foobar_onclick()
> >   with createobject("wscript.shell")
> >   .run "junk.vbs"
> >   end with
> > end sub
> > </script>
> > </head>
> > <body>
> > <a href="junk.vbs">junk</a>
> > <input id="foobar" type="button" value="junk">
> > </body>
> > </html>

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > > Hello I am new to making hta apps and wanted to know if there was a
way to
> > >  launch a vbs script without getting a download dialog box?

> > >  I have searched many webpages and the answer seems to have something
to
> > do
> > >  with making the app "trusted".

> > >  It was my understanding that hta's were already trusted but I can't
seem
> > > to make this work. Could somebody post an example of how this works.

> > >  Thanks



Thu, 22 May 2003 03:00:00 GMT  
 launch script from a hta?


Quote:
> hey that looks cool.

> I'll give it a try thanks


> > <object id="wsh"
> classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>

It's really just the same as using CreateObject("WScript.Shell")
(inVBScript) or new ActiveXObject (in JScript).

--
Robert Bradley

I am not a mindreader, so I don't know everything.



Sat, 24 May 2003 03:00:00 GMT  
 launch script from a hta?
Hi,

I don't know what this thread was about, but if you want to make
"library" routines for your HTAs, can't you just call the scripts using
"codebase=" ?

If you want to use WScript functionality in HTAs, can't you just use
WScript.CreateObject("blah.blah"); ?

Quote:



> > hey that looks cool.

> > I'll give it a try thanks


> > > <object id="wsh"
> > classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>

> It's really just the same as using CreateObject("WScript.Shell")
> (inVBScript) or new ActiveXObject (in JScript).

> --
> Robert Bradley

> I am not a mindreader, so I don't know everything.

--
Gerry Hickman (London UK)


Sat, 24 May 2003 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. launch vbs script from a hta app?

2. Launching HTA (HTML Applications)

3. Scripting HTA's HTA:APPLICATION Navigable property

4. Launching an EXE from an HTA?

5. Launching 6 .vbs scripts simultaneously from a single script

6. Launching 6 .vbs scripts simultaneously from a single script

7. Opening HTA from a HTA?

8. How to launch an HTML NAvigator from Scripting Host

9. Launching Application from a Client-side Script

10. Can an ASP script launch an external task?

11. Modify Quick Launch toolbar in script?

12. Permision Problem launching Excel from VBS Script on W2K

 

 
Powered by phpBB® Forum Software