Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

March 13, 2006 12:00 AM

Display System and BIOS Configurations

Windows IT Pro
InstantDoc ID #49363
Rating: (2)
Downloads
49363.zip

HTML Applications (HTAs) are standalone applications that work on Windows OSs with Microsoft Internet Explorer (IE) 5.0 and later. Double-clicking an .hta file runs it like any other executable. HTAs use the IE engine to render the application's menus, buttons, and so on. However, HTAs don't use IE's UI. With HTAs, you design the UI. (For an introduction on how to design HTA UIs, see "Hooked on HTAs," August 2005, InstantDoc ID 46795.)

In HTAs, you can use JScript or VBScript code and such technologies as Windows Management Instrumentation (WMI). I created a utility that uses VBScript code and WMI to retrieve OS information from the local computer. This utility is composed of four files: winutil.hta, winstup.hta, winosys.hta, and winbios.hta. Winutil.hta launches the other three .hta files. You can download the four files from the Windows Scripting Solutions Web site: Go to http://www.windowsitpro.com/windowsscripting, enter 49363 in the InstantDoc ID text box, then click the 49363.zip hotlink.

To install the utility, create a folder on your hard disk and place all the .hta files in it. Double-click the winutil.hta file to obtain the utility's menu, which Figure 1 shows. When you click the Display startup command option, winstup.hta executes and you receive information about the startup commands on the local computer. When you click the Operating System option, winosys.hta runs and you get information about the computer's OS. When you click the Bios option, you receive BIOS data. The menu contains only three items but is designed so that you can easily add other items. For example, suppose you want the utility to display information about the local machine's running processes. In winutil.hta, find the code

‹LI›‹a href="#" on Click="runhta
   ('winxxxhtaa')›Opt #4‹/a›

In this code, replace Opt #4 with an appropriate description (e.g., Running Process) and replace winxxx.hta with the name of the HTA you'll create to display the active processes (e.g., winprocess.hta). You can use winosys.hta as an example of how to write the winprocess.hta file. If you're unsure of the WMI class to use, you can go to the WMI Classes Web page at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_classes.asp. For winprocess.hta, you'd use the Win32_Process class. You can use the utility to do hardware and software inventory on a computer farm. To retrieve the characteristics of a remote computer, you need to change one line in the winstup.hta, winosys.hta, and winbios.hta files. Change the line

strComputer = "." 

to

strComputer = "remote_computer" 

where remote_computer is the remote computer's hostname (e.g., host0001). You must have the rights to execute the HTA on a remote computer. Note that an HTA can contain malicious code, so run only your HTAs in your computer farm.

The utility runs with Windows Scripting Host (WSH) 5.6 and later on Windows 2000 Server, Windows 2000 Professional, and Windows XP.

Related Content:

ARTICLE TOOLS

Comments
  • KHALED
    6 years ago
    Apr 19, 2006

    Great article.

  • PAT
    6 years ago
    Mar 24, 2006

    Your articles are interesting and informative but the constant pop-up or fly-out advertisments are distracting and irritating...especially when reading from my Tablet PC. C'mon! Give me a break. I pay a lot for my VIP Subscription.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.