Jump to content


Photo

A Guide to HTML Applications (HTAs)


  • Please log in to reply
1 reply to this topic

#1 toralf

toralf
  • Fellows
  • 3948 posts

Posted 25 January 2006 - 12:51 PM

I know BoBo has talked about HTAs several times before. But I never found a link to the basics of HTA. Since I just came around one, I wanted to post it.
Introduction to HTA

One of the very basic HTAs published on that site:
<head>
<title>HTA Test</title>
<HTA:APPLICATION 
     APPLICATIONNAME="HTA Test"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
>
</head>

<script language="VBScript">
    Sub GetOSVersion
        strComputer = "."
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

        Set colOperatingSystems = objWMIService.ExecQuery _
            ("Select * from Win32_OperatingSystem")

        For Each objOperatingSystem in colOperatingSystems
            DataArea.InnerHTML = objOperatingSystem.Caption & " " & _
                objOperatingSystem.Version
        Next

    End Sub
</script>

<body>
<input type="button" value="Operating System" name="run_button" onClick="GetOSVersion">
<p>
<span id = "DataArea"></span>
</body>


#2 not-logged-in-daonlyfreez

not-logged-in-daonlyfreez
  • Guests

Posted 25 January 2006 - 01:41 PM

Nice, thanks for the link...

You might have noticed that you can’t buy MS-DOS any more, and for good reason: after people got a look at Windows, well, typing in long, cryptic commands from the C:\ prompt just didn’t seem like nearly as much fun. The command prompt still has its place, but the success of Windows (and the Macintosh, and all the new Windows-like Unix shells) suggests that most people prefer a graphical user interface.


:lol: They make it sound as if they invented graphical shells...

Tip:

If you get an error (like me) when trying to open/run a hta file, try the following:

- Open an Explorer window.
- Goto menu 'Tools' -> 'Folder Options'
- Goto tab 'File Types'
- Goto the HTA extension
- Press the 'Change' button at 'Opens with:'
- Press the 'Other...' button in the 'Open with' window
- Goto the Windows folder (or WINNT) -> system32 -> Pick 'mshta.exe'
- Press 'Apply' and 'OK'

Should work now...