Langa Letter: Solving Automatic Maintenance Problems - InformationWeek
Software // Enterprise Applications
07:59 PM
Fred Langa
Fred Langa
Free Yourself from Legacy Apps
Jun 08, 2017
They've served their purpose years ago, but now they're stretching your IT budget and increasing s ...Read More>>

Langa Letter: Solving Automatic Maintenance Problems

Fred Langa explains how to address problems with Windows XP automation, looking at XP's self-maintenance tools and techniques.

In "Make Windows XP Self-Maintaining", we discussed how to automate Windows XP tools and tasks that normally require manual intervention. This involves three steps: (1) finding the right text command(s) and modifiers to launch the maintenance tool or process that you want, in the way you want; (2) building a simple script or batch file to issue the command; and (3) using Task Scheduler to execute the script or batch file at the desired times. (This is, of course, a highly compressed explanation. Please see the original article for the full detail.)

But there are cases where this automation method won't work as intended or may prove unwieldy. For example, XP's Backup applet is one of the most configurable--and thus most complex--of that operating system's built-in maintenance tools. A command to launch the Backup applet with all the normal options can involve well over 300 characters' worth of obscure shorthand data, each element of which must be in precisely the correct position, format, and sequence. It's way too much data to try to figure out and enter accurately by hand.

There can be other automation troubles, too, including very common problems with permissions and passwords for scheduled maintenance events.

And sometimes, XP gets in its own way. For example, the XP Backup applet comes with a "Wizard" to simplify its use, but on its own, the Wizard produces a standalone task that may not integrate well with other maintenance tasks. If Backup is the only task you want to run, then there's no problem, but if you want to perform a more-complicated series of maintenance tasks, you may run into serious trouble:

Let's say you want to have your PC automatically wake itself up every day at 3 a.m., clean up your hard drive, back up all your files, defrag every disk or partition in your system, and then go back to sleep. If you use only XP's built-in Backup Wizard, you'll have no simple way of ensuring that your backups will run the way you want--after the cleanup but before the defrag. You're basically forced to guess when to launch Wizard-generated maintenance tasks, hoping you've allowed enough time in between. Of course, if you guess wrong, two or more tasks may end up competing for the hard drive at the same time. In some cases, tasks that compete this way may never run to completion. This, in fact, is the major limitation of the Backup Wizard and similar crude schedulers: Your tasks exist largely in isolation, rather than being smoothly integrated into your overall maintenance procedures.

"Make Windows XP Self-Maintaining" showed how a script or batch file can correctly sequence a whole series of maintenance tasks, helping to ensure that one task finishes before another begins. But handcrafted scripts and batch files can have their own limitations, too, especially when you're talking about automating a tool like Backup that may require an enormously complex command line hundreds of characters long.

The solution is a hybrid approach: Use a tool like the Backup Wizard to generate the complex command line you want, then lift that command line and use it in your own simple scripts or batch files. That way, you get all the power and ease of the Wizard approach but all the flexibility and proper sequencing of the script or batch file approach.

This works not only for XP's Backup applet but also for many other complex tools and utilities that have a Wizard or similar front end that integrates with Task Scheduler. You can lift the automatically generated command line out of Task Scheduler to use as you see fit in your own custom scripts and batch files. It's easy and opens up incredible power to you.

This may sound confusing, but seeing a specific example (we'll use Backup as our case in point), will make everything clearer.

1 of 4
Comment  | 
Print  | 
More Insights
Threaded  |  Newest First  |  Oldest First
How Enterprises Are Attacking the IT Security Enterprise
How Enterprises Are Attacking the IT Security Enterprise
To learn more about what organizations are doing to tackle attacks and threats we surveyed a group of 300 IT and infosec professionals to find out what their biggest IT security challenges are and what they're doing to defend against today's threats. Download the report to see what they're saying.
Register for InformationWeek Newsletters
White Papers
Current Issue
2017 State of Data and Analytics
Today's companies are differentiating themselves using data analytics, but the journey requires adjustments to people, processes, technology, and culture. 
Twitter Feed
InformationWeek Radio
Archived InformationWeek Radio
Join us for a roundup of the top stories on for the week of November 6, 2016. We'll be talking with the editors and correspondents who brought you the top stories of the week to get the "story behind the story."
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.
Flash Poll