Export (0) Print
Expand All
Expand Minimize
1 out of 17 rated this helpful - Rate this topic

Creating Your Own HTAs

Try It Yourself: Add a Button to an HTA

Shows how to add a button (with the label Service Pack) to an HTA. This is the answer to a Try It Yourself exercise found in the introductory tutorial on creating HTAs.

<title>Operating System Version</title>
     APPLICATIONNAME="Operating System Version"

<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
               Msgbox objOperatingSystem.Caption & " " & _
    End Sub

<input type="button" value="Operating System" name="run_button"  onClick="GetOSVersion">
<input type="button" value="Service Pack" name="service_pack"  onClick="GetServicePack">


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.