Mr. Script

Going Hyper-Active

Build scripts that work more like applications so you can monitor progress and display results in a formatted manner.

Every year at this time I like to try something new and different—perhaps a new food that I was never brave enough to try before. In keeping with that spirit, I'd like you to try something new this year, as well: HTML Applications, also known as HTAs.

A downside of scripts is that they're not very interactive. Most of the time when you run a script, you just see a blank command-line window while you wait for either a C:\> prompt indicating success, or an error message telling you to start over.

Well, fret no more. HTAs present a useful scripting interface that enables you to monitor progress, display results in a formatted manner, and, well … just build scripts that work more like applications. All you need is your script code and a little bit of HTML know-how.

Let's take a look at how they work. Copy the following code or right click here to download a text version of the code . Save the file with the .HTA extension and double-click it. You might have to right-click it and select "Open With …" and specify Internet Explorer. Once it runs, you'll see that world-famous "Hello World" application appear:



My First HTA


ID="objMyFirstHTA"
APPLICATIONNAME="Hello World"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal">



About the Author

Chris Brooke, MCSE, is a contributing editor for Redmond magazine and director of enterprise technology for ComponentSource. He specializes in development, integration services and network/Internet administration. Send questions or your favorite scripts to [email protected].

Featured

  • Microsoft Clarifies Project Cortex's Scope, IT Controls and Product Delivery in Q&A

    Microsoft recently offered a Q&A session on Project Cortex, its emerging "knowledge network" solution for Microsoft 365 users.

  • How To Use .CSV Files with PowerShell, Part 2

    In the second part of this series, Brien shows how to import a .CSV file into a PowerShell array, including two methods for zooming in on just the specific data you need and filtering out the rest.

  • Windows 10 Preview Adds Ability To Display Linux Distro Files

    Microsoft on Wednesday announced Windows 10 preview build 19603, which adds easier access to installed Linux distro files using Windows File Explorer.

  • Microsoft 365 Business To Get Azure Active Directory Premium P1 Perks

    Subscribers to Microsoft 365 Business (which is being renamed this month to "Microsoft 365 Business Premium") will be getting Azure Active Directory Premium P1 licensing at no additional cost.

comments powered by Disqus

Office 365 Watch

Sign up for our newsletter.

Terms and Privacy Policy consent

I agree to this site's Privacy Policy.