Langa Letter: Solving Automatic Maintenance Problems - InformationWeek

InformationWeek is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Software // Enterprise Applications
07:59 PM
Fred Langa
Fred Langa

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.

We welcome your comments on this topic on our social media channels, or [contact us directly] with questions about the site.
1 of 4
Comment  | 
Print  | 
More Insights
Augmented Analytics Drives Next Wave of AI, Machine Learning, BI
Jessica Davis, Senior Editor, Enterprise Apps,  3/19/2020
How Startup Innovation Can Help Enterprises Face COVID-19
Joao-Pierre S. Ruth, Senior Writer,  3/24/2020
Enterprise Guide to Robotic Process Automation
Cathleen Gagne, Managing Editor, InformationWeek,  3/23/2020
White Papers
Register for InformationWeek Newsletters
Current Issue
IT Careers: Tech Drives Constant Change
Advances in information technology and management concepts mean that IT professionals must update their skill sets, even their career goals on an almost yearly basis. In this IT Trend Report, experts share advice on how IT pros can keep up with this every-changing job market. Read it today!
Flash Poll