How to invoke an executable (.EXE) from within an HTA page?

D

David F

More generally, how is the entire interface mechanism between an .HTA
page/application and a Windows (and/or a Consol) executable is defined?
That means:
How to invoke a .EXE and passing parameters?
How to return control to the .HTA page with possibly return some values and
regardless of whether the .EXE exits or continues to run (or idle) in the
background?

Where can I read about that stuff?

Thanks,
David
 
D

David F

1. I have already looked at that entire area of MSDN and did not find one
(detailed or any) example of how to make such a call.
2. And what if I want to use JavaScript for example?
3. And what about the rest of the interface as I mentioned which is not
discussed there at all?

David
 
S

Stefan B Rusynko

Start here http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
- not possible w/ JavaScript




| 1. I have already looked at that entire area of MSDN and did not find one
| (detailed or any) example of how to make such a call.
| 2. And what if I want to use JavaScript for example?
| 3. And what about the rest of the interface as I mentioned which is not
| discussed there at all?
|
| David
|
| | > It would be done by running a VB Script inside the .hta which calls
| shellexecute and pass the
| > parameters via the shellexecute.
| >
| > Here's a link:
| >
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/hta_node_entry.asp
| >
| > --
| > Steve Easton
| > Microsoft MVP FrontPage
| > 95isalive
| > This site is best viewed............
| > .......................with a computer
| >
| | > > More generally, how is the entire interface mechanism between an .HTA
| > > page/application and a Windows (and/or a Consol) executable is defined?
| > > That means:
| > > How to invoke a .EXE and passing parameters?
| > > How to return control to the .HTA page with possibly return some values
| and
| > > regardless of whether the .EXE exits or continues to run (or idle) in
| the
| > > background?
| > >
| > > Where can I read about that stuff?
| > >
| > > Thanks,
| > > David
| > >
| > >
| >
| >
|
|
 
D

David F

Thanks.

I new that with MS there must be a catch and that is why I wrote: "It is too
good to be true".
In this case, forcing you to use MS' proprietary VB Script (and maybe
Jscript?) but not an ISO standard such as JavaScript.

David
 
D

David F

1. How would you call it then? (instead of how would you NOT call...)
2. You totally lost me - what is the relevancy of and moreover, what do you
mean by "...comes with VBScript"?
Windows come with a gazillion of things, so what? If anything, it also
"comes with" JavaScript (IE understand JavaScript which is a standard
scripting language that runs virtually on all machines) so why block out
JavaScript? The only logical explanation I can think of is that MS wants to
keep applications running on Windows not easily be portable to other OSes.
And that is why I think that this was the catch. If you have a better
explanation, I would be happy to learn about it. The only think that disturb
me is that I wasted time to read about while up until this very moment, I
have not seen yet one sentence from MS saying that I HAVE to use VBScript.
As a matter of fact, all the material I read so far just draws a rosy
picture as if ANY common script would work (by omission or being SILENT
about the important things). If it would not be people in this form, I would
still not know the hard fact of life about such a key aspect. These are all
snake-oil tactics.
I would be more than happy to learn that I was wrong.

David

MD Websunlimited said:
I'm not sure I would call this a catch as the HTA must be run on a windows
machine that comes with VBScript
 
S

Stefan B Rusynko

You can call it what you want
- all browsers / OS block .exes from web interface for Security reasons
- JavaScript is client side and totally unsecure and not a MS technology
- MS develops a tool that w/ constraints and lots of security warnings can run an exe for willing clients using Server side
Scripting (it has no obligation to create it in any server side language other that a MS developed / supported one)
If you don't like the tool don't use it
- find another OS or develop your own




| 1. How would you call it then? (instead of how would you NOT call...)
| 2. You totally lost me - what is the relevancy of and moreover, what do you
| mean by "...comes with VBScript"?
| Windows come with a gazillion of things, so what? If anything, it also
| "comes with" JavaScript (IE understand JavaScript which is a standard
| scripting language that runs virtually on all machines) so why block out
| JavaScript? The only logical explanation I can think of is that MS wants to
| keep applications running on Windows not easily be portable to other OSes.
| And that is why I think that this was the catch. If you have a better
| explanation, I would be happy to learn about it. The only think that disturb
| me is that I wasted time to read about while up until this very moment, I
| have not seen yet one sentence from MS saying that I HAVE to use VBScript.
| As a matter of fact, all the material I read so far just draws a rosy
| picture as if ANY common script would work (by omission or being SILENT
| about the important things). If it would not be people in this form, I would
| still not know the hard fact of life about such a key aspect. These are all
| snake-oil tactics.
| I would be more than happy to learn that I was wrong.
|
| David
|
| | > I'm not sure I would call this a catch as the HTA must be run on a windows
| machine that comes with VBScript
| > --
| > Mike -- FrontPage MVP '97 - '02
| > http://www.websunlimited.com
| >
| >
| >
| | > > Thanks.
| > >
| > > I new that with MS there must be a catch and that is why I wrote: "It is
| too
| > > good to be true".
| > > In this case, forcing you to use MS' proprietary VB Script (and maybe
| > > Jscript?) but not an ISO standard such as JavaScript.
| > >
| > > David
| > >
| > > | > >> Start here
| > >
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
| > >> - not possible w/ JavaScript
| > >>
| > >> --
| > >>
| > >> _____________________________________________
| > >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > >> "Warning - Using the F1 Key will not break anything!" (-;
| > >> To find the best Newsgroup for FrontPage support see:
| > >> http://www.net-sites.com/sitebuilder/newsgroups.asp
| > >> _____________________________________________
| > >>
| > >>
| > > | > >> | 1. I have already looked at that entire area of MSDN and did not find
| > > one
| > >> | (detailed or any) example of how to make such a call.
| > >> | 2. And what if I want to use JavaScript for example?
| > >> | 3. And what about the rest of the interface as I mentioned which is
| not
| > >> | discussed there at all?
| > >> |
| > >> | David
| > >> |
| > >> | | > >> | > It would be done by running a VB Script inside the .hta which calls
| > >> | shellexecute and pass the
| > >> | > parameters via the shellexecute.
| > >> | >
| > >> | > Here's a link:
| > >> | >
| > >> |
| > >
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/hta_node_entry.asp
| > >> | >
| > >> | > --
| > >> | > Steve Easton
| > >> | > Microsoft MVP FrontPage
| > >> | > 95isalive
| > >> | > This site is best viewed............
| > >> | > .......................with a computer
| > >> | >
| > >> | | > >> | > > More generally, how is the entire interface mechanism between an
| > > .HTA
| > >> | > > page/application and a Windows (and/or a Consol) executable is
| > > defined?
| > >> | > > That means:
| > >> | > > How to invoke a .EXE and passing parameters?
| > >> | > > How to return control to the .HTA page with possibly return some
| > > values
| > >> | and
| > >> | > > regardless of whether the .EXE exits or continues to run (or
| idle)
| > > in
| > >> | the
| > >> | > > background?
| > >> | > >
| > >> | > > Where can I read about that stuff?
| > >> | > >
| > >> | > > Thanks,
| > >> | > > David
| > >> | > >
| > >> | > >
| > >> | >
| > >> | >
| > >> |
| > >> |
| > >>
| > >>
| > >
| > >
| >
| >
|
|
 
S

Steve Easton

You can use javascript in a .hta but it depends on what you're trying to do.

You need to know / consider "domains" on a computer.

For example there is the system "domain" and the browser "domain"

By default an .hta opens and runs in the browser "domain" but if properly scripted with the proper
permissions set it can access the system "domain."

However, you can't access the system "domain" using javascript because it is a browser "scripting
language."
You can however access the system "domain" using vb script because vb script runs in the windows
Scripting Host ( WSH )
which runs in the system "domain."

You can use javascript to "fire" a vb script.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

Read my response to your earlier comment.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
D

David F

So that you don't remain totally in the dark about HTA, I bring you here MS'
opening paragraph describing HTA.
This is to help you avoid from unintentionally responding misleadingly
innocent participants of the forum.
The main page describing the HTA is at:
http://www.msdn.microsoft.com/library/default.asp
The highlighting is mine but the entire content is by MS.

HTML Applications



HTML Applications (HTAs) are full-fledged applications.

These applications are trusted and display only the menus, icons, toolbars,
and title information that the Web developer creates.

In short, HTAs pack all the power of Microsoft Internet Explorer-its object
model, performance, rendering power, protocol support,

and channel-download technology-without enforcing the strict security model
and user interface of the browser.


David



Stefan B Rusynko said:
You can call it what you want
- all browsers / OS block .exes from web interface for Security reasons
- JavaScript is client side and totally unsecure and not a MS technology
- MS develops a tool that w/ constraints and lots of security warnings can
run an exe for willing clients using Server side
Scripting (it has no obligation to create it in any server side language
other that a MS developed / supported one)
If you don't like the tool don't use it
- find another OS or develop your own




| 1. How would you call it then? (instead of how would you NOT call...)
| 2. You totally lost me - what is the relevancy of and moreover, what do you
| mean by "...comes with VBScript"?
| Windows come with a gazillion of things, so what? If anything, it also
| "comes with" JavaScript (IE understand JavaScript which is a standard
| scripting language that runs virtually on all machines) so why block out
| JavaScript? The only logical explanation I can think of is that MS wants to
| keep applications running on Windows not easily be portable to other OSes.
| And that is why I think that this was the catch. If you have a better
| explanation, I would be happy to learn about it. The only think that disturb
| me is that I wasted time to read about while up until this very moment, I
| have not seen yet one sentence from MS saying that I HAVE to use VBScript.
| As a matter of fact, all the material I read so far just draws a rosy
| picture as if ANY common script would work (by omission or being SILENT
| about the important things). If it would not be people in this form, I would
| still not know the hard fact of life about such a key aspect. These are all
| snake-oil tactics.
| I would be more than happy to learn that I was wrong.
|
| David
|
| | > I'm not sure I would call this a catch as the HTA must be run on a windows
| machine that comes with VBScript
| > --
| > Mike -- FrontPage MVP '97 - '02
| > http://www.websunlimited.com
| >
| >
| >
| | > > Thanks.
| > >
| > > I new that with MS there must be a catch and that is why I wrote: "It is
| too
| > > good to be true".
| > > In this case, forcing you to use MS' proprietary VB Script (and maybe
| > > Jscript?) but not an ISO standard such as JavaScript.
| > >
| > > David
| > >
| > > | > >> Start here
| > >
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
| > >> - not possible w/ JavaScript
| > >>
| > >> --
| > >>
| > >> _____________________________________________
| > >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > >> "Warning - Using the F1 Key will not break anything!" (-;
| > >> To find the best Newsgroup for FrontPage support see:
| > >> http://www.net-sites.com/sitebuilder/newsgroups.asp
| > >> _____________________________________________
| > >>
| > >>
| > > | > >> | 1. I have already looked at that entire area of MSDN and did not find
| > > one
| > >> | (detailed or any) example of how to make such a call.
| > >> | 2. And what if I want to use JavaScript for example?
| > >> | 3. And what about the rest of the interface as I mentioned which is
| not
| > >> | discussed there at all?
| > >> |
| > >> | David
| > >> |
| > >> | | > >> | > It would be done by running a VB Script inside the .hta which calls
| > >> | shellexecute and pass the
| > >> | > parameters via the shellexecute.
| > >> | >
| > >> | > Here's a link:
| > >> | >
| > >> |
| > >
| http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/hta_node_entry.asp
| > >> | >
| > >> | > --
| > >> | > Steve Easton
| > >> | > Microsoft MVP FrontPage
| > >> | > 95isalive
| > >> | > This site is best viewed............
| > >> | > .......................with a computer
| > >> | >
| > >> | | > >> | > > More generally, how is the entire interface mechanism between an
| > > .HTA
| > >> | > > page/application and a Windows (and/or a Consol) executable is
| > > defined?
| > >> | > > That means:
| > >> | > > How to invoke a .EXE and passing parameters?
| > >> | > > How to return control to the .HTA page with possibly return some
| > > values
| > >> | and
| > >> | > > regardless of whether the .EXE exits or continues to run (or
| idle)
| > > in
| > >> | the
| > >> | > > background?
| > >> | > >
| > >> | > > Where can I read about that stuff?
| > >> | > >
| > >> | > > Thanks,
| > >> | > > David
| > >> | > >
| > >> | > >
| > >> | >
| > >> | >
| > >> |
| > >> |
| > >>
| > >>
| > >
| > >
| >
| >
|
|
 
D

David F

Hi Steve,

If YOU would read my response to your earlier comment, you would know that I
more than read it....

David
 
S

Steve Easton

I meant the one immediately below this one

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
D

David F

Steve,

I apologize - apparently I confused which response of yours you meant.

From what you wrote, I guess that for my goals as I laid out originally, the
faith of JScript is the same as of JavaScript. Please let me know I guessed
wrongly.
To use javascript just to "fire" a VB script. does not address my goals of
course.

I just installed today VS - 2005 Beta 2 and will see to what extend MS'
claim that this time around they are supporting C/C++ or in their words
"...and now C/C++". This is in contrast to VS 2003 where their claims about
supporting C++ were bogus (in my book at least - "managed" C/C++ is simply
not C/C++ ). If they do, and together with reasonable UI API, I may just
forget about HTA (which turns out to be proprietary anyway) and go back to
more traditional UI API.

David
 
T

Thomas A. Rowe

Have you considered posting to the VS newsgroup, since what you are trying to accomplish is really
outside the scope of using FP?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
S

Steve Easton

I understand your frustration. Supposedly in FP 2003 you can compile C++ into an
unmanaged ( Non .NET dependent )
executable. However I could never figure out how to do it.

So I started over from scratch using Visual Studio 6.0 so that my little 64kb utility
didn't require users to download 15MB worth of .NET in order for it to work.

That said, .NET is not bad, nor is managed code. However imho .NET is severely
misunderstood by a lot of people and imho MSFT didn't do a good job of kicking off the
".NET initiative."

Additionally, life would be a lot easier had MSFT added .NET to the system as part of an
update / upgrade or started including it as part of an OS install.

As it is now, when people see that an application that they want to download / install
requires .NET they decide not to install it.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
D

David F

I did but since the nature of my question is associated for the most part
with web pages, and VS is just too wide, I thought maybe here is the best
place.
Anyway, thanks for the idea and will recheck the alternative.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top