Software // Enterprise Applications
Commentary
11/12/2003
07:59 PM
Fred Langa
Fred Langa
Commentary
Connect Directly
RSS
E-Mail
50%
50%

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.

Previous
1 of 4
Next
Comment  | 
Print  | 
More Insights
Building A Mobile Business Mindset
Building A Mobile Business Mindset
Among 688 respondents, 46% have deployed mobile apps, with an additional 24% planning to in the next year. Soon all apps will look like mobile apps and it's past time for those with no plans to get cracking.
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest - August 27, 2014
Who wins in cloud price wars? Short answer: not IT. Enterprises don't want bare-bones IaaS. Providers must focus on support, not undercutting rivals.
Flash Poll
Video
Slideshows
Twitter Feed
InformationWeek Radio
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.