newbie question 
Author Message
 newbie question

Hi all

I`m writing a menu for a cd and have decided to give it a ago in HTML
Application
i have the .hta file all layed out but i can`t get it to run an install
program when a button is clicked.

I have :
<script language="VBScript">
<button name="blah" value="install" onclick="shell(c:\windows\notepad.exe)">
</script>

Is this the correct syntax as i cannot get it to work, i have no knowledge
of vbscript and have just tried this out of the knowledge of vb hat i can
remember

Any help would be greatly appreciated

Thanks

G



Sun, 11 May 2003 03:00:00 GMT  
 newbie question
Gary: Give the following a try -- I've only played a little with HTA so I'm
not sure what's legal and what's not, but you need to set up a windows
scripting host shell to execute your app. So try:

<INPUT TYPE=BUTTON VALUE="Install" NAME="BtnInstall>

<SCRIPT LANGUAGE="VBScript">
<!-- Option Explicit
     Sub BtnInstall_OnClick
         dim wshShell
         set wshShell = WScript.CreateObject("Wscript.Shell")
         wshShell.run "C:\windows\notepad.exe"
     End Sub
-->
</SCRIPT>


Quote:
> Hi all

> I`m writing a menu for a cd and have decided to give it a ago in HTML
> Application
> i have the .hta file all layed out but i can`t get it to run an install
> program when a button is clicked.

> I have :
> <script language="vbscript">
> <button name="blah" value="install"

onclick="shell(c:\windows\notepad.exe)">
Quote:
> </script>

> Is this the correct syntax as i cannot get it to work, i have no knowledge
> of vbscript and have just tried this out of the knowledge of vb hat i can
> remember

> Any help would be greatly appreciated

> Thanks

> G



Sun, 11 May 2003 03:00:00 GMT  
 newbie question
The object you are after is the WshShell object (progid "WScript.Shell") which has a Run method.

Since this is an HTA, you can create any object from script in an HTA that you can from standalone
script hosted by WScript/CScript.exe.  You just can't use the built-in WScript object itself
(mshta.exe is the host, not wscript/cscript)...

The EXE links are downloads of the complete documentation sets in HTMLHelp format - highly
recommended for offline use.  The "...User's Guide" content is also included in the downloaded
documentation...

WSH 2.0 Tutorial
http://msdn.microsoft.com/scripting/windowshost/doc/wsTutorialTOC.htm
WSH Documentation
http://msdn.microsoft.com/scripting/windowshost/docs/reference/defaul...
http://msdn.microsoft.com/scripting/windowshost/wshdoc.exe

VBScript User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/vbstutor.htm
VBScript Documentation
http://msdn.microsoft.com/scripting/vbscript/techinfo/vbsdocs.htm
http://msdn.microsoft.com/scripting/vbscript/download/vbsdoc.exe

FileSystemObject User's Guide
http://msdn.microsoft.com/scripting/vbscript/doc/jsFSOTutor.htm
VBScript Run-Time Library Reference [FileSystemObject/Dictionary]
http://msdn.microsoft.com/scripting/vbscript/doc/VBSFSOTOC.htm

JScript User's Guide
http://msdn.microsoft.com/scripting/jscript/doc/jsconJScriptUsersGuid...
JScript Documentation
http://msdn.microsoft.com/scripting/jscript/techinfo/jsdocs.htm
http://msdn.microsoft.com/scripting/jscript/download/jsdoc.exe

WSC Tutorial
http://msdn.microsoft.com/scripting/scriptlets/doc/lettitle.htm
WSC Documentation
http://msdn.microsoft.com/scripting/scriptlets/serverdocs.htm
http://msdn.microsoft.com/scripting/scriptlets/wscdoc.exe

--
Michael Harris
Microsoft.MVP.Scripting
--

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

Quote:

> Hi all

> I`m writing a menu for a cd and have decided to give it a ago in HTML
> Application
> i have the .hta file all layed out but i can`t get it to run an install
> program when a button is clicked.

> I have :
> <script language="vbscript">
> <button name="blah" value="install" onclick="shell(c:\windows\notepad.exe)">
> </script>

> Is this the correct syntax as i cannot get it to work, i have no knowledge
> of vbscript and have just tried this out of the knowledge of vb hat i can
> remember

> Any help would be greatly appreciated

> Thanks

> G



Sun, 11 May 2003 03:00:00 GMT  
 newbie question
Thanks for your help Mike + Bret, somehow it wasn`t as simple as i wanted it
to be ;)
anyhow i think i`m gonna have to give this .hta stuff a proper go as it
looks challenging and quite deep and looks like i could get some good
results with it :)

G


Quote:
> Hi all

> I`m writing a menu for a cd and have decided to give it a ago in HTML
> Application
> i have the .hta file all layed out but i can`t get it to run an install
> program when a button is clicked.

> I have :
> <script language="vbscript">
> <button name="blah" value="install"

onclick="shell(c:\windows\notepad.exe)">
Quote:
> </script>

> Is this the correct syntax as i cannot get it to work, i have no knowledge
> of vbscript and have just tried this out of the knowledge of vb hat i can
> remember

> Any help would be greatly appreciated

> Thanks

> G



Mon, 12 May 2003 03:00:00 GMT  
 newbie question

Quote:

> Thanks for your help Mike + Bret, somehow it wasn`t as simple as i wanted it
> to be ;)
> anyhow i think i`m gonna have to give this .hta stuff a proper go as it
> looks challenging and quite deep and looks like i could get some good
> results with it :)

If it's any consolation, once you get the hang of it, it's a lot simpler than it first appears
;-)...

--
Michael Harris
Microsoft.MVP.Scripting
--

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



Tue, 13 May 2003 03:00:00 GMT  
 newbie question



Quote:
> > Thanks for your help Mike + Bret, somehow it wasn`t as simple as i
wanted it
> > to be ;)
> > anyhow i think i`m gonna have to give this .hta stuff a proper go as it
> > looks challenging and quite deep and looks like i could get some good
> > results with it :)

> If it's any consolation, once you get the hang of it, it's a lot simpler

than it first appears

Quote:
> ;-)...

Are there any Documentations like the ones you provided me with before
solely on Html Application ?

Thanks.

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

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



Wed, 14 May 2003 03:00:00 GMT  
 newbie question
http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

might be a good place to start.


Quote:

> Are there any Documentations like the ones you provided me with before
> solely on Html Application ?

> Thanks.



Wed, 14 May 2003 03:00:00 GMT  
 newbie question
In addition to the <HTA:APPLICATION> element, the rest is just general DHTML/CSS and other external
object models (like WScript.BlahBlah objects, ADO.Whatever, Scripting.FileSystem, etc. etc.)...

DHTML/CSS Documentation
http://msdn.microsoft.com/workshop/default.asp

--
Michael Harris
Microsoft.MVP.Scripting
--

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

Quote:

> http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

> might be a good place to start.



> > Are there any Documentations like the ones you provided me with before
> > solely on Html Application ?

> > Thanks.



Wed, 14 May 2003 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Newbie question: Session_OnEnd question

2. Resizing forms question (newbie question)

3. Access97 VBA newbie question

4. Newbie Question: Understanding Syntax

5. Newbie question:

6. Newbie Questions About DAO Queries to SQL Server

7. Brand newbie questions

8. Newbie question

9. Newbie question: open file

10. vba Newbie Question

11. Newbie Question: Getting the Values from Calculated controls into a table

12. Newbie question for calling functions

 

 
Powered by phpBB® Forum Software