Tip

How to automate advanced Windows desktop tasks using scripts and macros

When I began this series on desktop tasks you should be automating, I focused on common tasks, such as keeping Windows temporary directories clean or upgrading applications.

    Requires Free Membership to View

But at some point, if you're serious about desktop automation, you'll want to know how to move beyond individual applications and tasks. I'm talking about scripting, and one of the advantages to writing scripts or macros to do automation is there's more macro and scripting languages for Windows than ever.

One of the most obvious is Microsoft's Windows Script Host (WSH). WSH files (the file format used for such scripts) can be created with nothing more than Notepad or another text editor, and can address just about any system component that has a programmatic interface.

The Windows Script Host language has gained a bad reputation (undeservedly so, in my opinion) because it's been used, through programs like Internet Explorer, to launch exploits. But when used on its own and with proper user permissions, it's a convenient and powerful way to automate many Windows desktop tasks that don't lend themselves naturally to batch-file type operations. The best way to learn about it is to sit down and write a few scripts under the guidance of a good Windows Script Host (WSH) tutorial.

There are also third-party batch languages. One of the longest-lived and best-supported third-party batch scripting solutions is WinBatch, which has a veritable palette of libraries and functions that can control just about every imaginable aspect of Windows' behavior. Although it isn't suited to create actual applications, it can control them -- even when a given application doesn't have an exposed control API.

If you're not a programmer and don't want to spend the time to become one (or the cash to hire one), there are other ways to create macros. One method is to use an application that records your actions, writes the results to a file, then lets you play it back or edit it. Back in the days of Windows 3.1, Microsoft bundled such an application with Windows, called Macro Recorder.

Microsoft has omitted Macro Recorder in subsequent versions of Windows (possibly as a security measure), but plenty of third-party solutions have sprung up in its wake. A basic one is Auto Macro Recorder from ReadmeSoft, while  Workspace Macro Pro from Tethys Solutions offers advanced features such as automatically compensating for changing desktop conditions and logging of macro results. Both programs have free trial versions and sliding cost scales, depending on how many workstations you're licensing.

For a macro tool that combines the best of both worlds, check out Aldo's Macro Recorder. It lets you record macros and integrate Visual Basic Script programming into them as well. Version 4.1 is priced at $15.95.


Five Windows desktop tasks you should automate
- Introduction
- How to automate Windows software updates
- How to automate cleanup of Windows temporary directories
- How to automate Windows desktop folder synchronization
- How to automate Windows desktop backup tasks
- How to automate advanced Windows desktop tasks

About the author: Serdar Yegulalp is editor of the Windows Insight, (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of Windows experience under his belt, and contributes regularly to SearchWinComputing.com and SearchSQLServer.com.

This was first published in December 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.