Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bind to hta like you can with IE? 1

Status
Not open for further replies.

mrmovie

Technical User
Oct 2, 2002
3,094
GB
Hi all, I need to automate the user interaction with a HTA. i seem to recall seeing similar stuff using the IE application interface from vbscript but cant find anything on binding to the mshta session and manipulating it?

ta.


(long story why I can just give the same net result but am not allowed to, perhaps thats the solution and its an argument that needs to be had, but)
 
I'm not sure what "binding" to it might mean, but mshta.exe does not appear to expose an automation interface as IE itself does. Even if it did you couldn't pass the necessary command line to it that tells it what .HTA file to load and run.
 
thanks dilettante, thought someone might point me in the right direction or confirm my fears. shame that the 'real' things that the hta accomplishes arent called from an include file then i could just use that
 
I'm not sure what you're getting at by "include file."

An HTA can use external script files or CSS files just like an HTML page. Frames and iframes can use external HTML too.

An HTA may even be able to host the Script Control, allowing an HTA to load and run user-written scripts to automate its actions.

Most of the time the HTA is meant to be the user interface a user interacts directly with. It in turn runs script to manipulate its own DOM and various COM objects. Here it sounds like you want to use some HTA as the "horse" out in front of the cart instead of sitting in the seat holding the reins where an HTA normally would be.

Maybe if you could describe the problem a little more sombody could suggest a solution?
 
its cool, thanks dilettante. the "powers at be" already have a hta which consists of the horse, the cart and a barrell load of rotten apples. the net result of someone using the hta is to generate a couple of ini files, format a disk, copy some files about and initiate a reboot. for testing purposes (and really in prod as well) it is pretty boring having to manually do this all time. i wont get away with modifying any of the hta so just want to 'automate' what the hta is doing. the safest way (by this i mean keeping in line with what the hta is functionally doing) would be to just automate the user input (hence the bind to hta like IE webpage bit). given its not possible like that (other then sendkeys which i wont entertain) then will just have to create some sort of task sequence to do the blackbox stuff that the hta does. (which will be a positive thing in the long run)

ta
 
Oh I see. Quite a funky situation then.

Sendkeys might be the only option though I'm no fan myself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top