4

I recenty stumbled upon some files described as "HTML Applications" on my Win XP machine.

  • What are they?
  • Who would ever use them? Why do I have like 2 or 3 of them on my PC?
  • How do they generally work? I mean hey - HTML is for adding formatting to text - HTML Applications? What the? Microsoft?
3
  • Whoever downvoted this, please state why, I can't figure out what should be wrong with this question. Commented Apr 10, 2010 at 13:12
  • They are usually used as a quick way to make a reasonable looking splash screen that has limited user interaction; one common use is on CDROMs etc to provide a launch pad for other functionality on the cdrom. Commented Apr 10, 2010 at 13:28
  • Well maybe it was downvoted because your question is a little derogatory, not just asking for information but also implying ridicule of Microsoft just because you don't understand why HTAs are useful. Commented Apr 13, 2010 at 20:52

2 Answers 2

4

HTAs are good for things like VB scripts that you want an interface for other than MsgBox or a console window.

Since it's HTML, you can use buttons, text areas, check boxes, etc to show information to the user and get input from them, and use CSS to style it all. Since HTAs run on the local machine, you have access to everything you can do with VBScript for computation and file access, WMI for system management, program automation with COM objects, data access with ADO, and so on.

I once wrote an HTA that installs, updates, and compares Word templates on a user's machine from a common folder. The user can see their template folder next to the common folder to know if they are up to date, and hit the Update button if not.

Another one manages and verifies the installation of a program on a user's computer, copying over the exe if necessary, making sure registry entries are set correctly, putting a shortcut on the desktop, letting the user test and see the results of the installation, and so on. It also logs all of this info to a common place for me to check on.

One of my biggest HTA projects was a Project Manager system. The interface showed me all of the Excel, Word or Access projects I had going on. It would open the selected project in its particular environment, and showed me all of the pieces of it. It allowed me to import and export code modules from a common library using VBE automation (the Visual Basic Editor COM interface).

I'm about to put one together to show current and "dead" printer drivers on a user's machine. With me coaching them over the phone, they will run the HTA which will list all of the installed printers. They will put a check mark next to the ones they want to keep, then hit a button to delete all of the others. Fairly easy for them, and saves me from going to each and every PC to fix this.

Many of these kinds of things only make sense in a Windows environment, but you can write some pretty general purpose stuff with it too. Anything you can express in VBScript or JScript (JavaScript) and want an HTML/CSS front on is a good candidate for an HTA. I also even wrote a basic network chat system in it at one point.

There are lots of little HTAs around for converting data from one format to another, say converting comma separated data to columnar, or adding or removing various kinds of formatting like quote-printable escape codes, converting hex formatted text into plain text, and on and on. Copy text into one input text area, check a few options and press the Go button, then copy the converted data from the output text area. One I wrote was an SQL formatter. It would take SQL code and wrap it up as either a VB or Delphi string, and also go from wrapped back to plain SQL code, with basic indenting and "pretty printing" to clean it up.

I don't do as much with HTAs as I used to, but still think they are a pretty cool technology for the kinds of jobs that fit in that niche.

Sign up to request clarification or add additional context in comments.

Comments

4

See here for Introduction to HTML Applications (HTAs).

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.