Microsoft

Tech Tip: Save time with Doskey macros

Windows XP's command-line utilities are useful in many situations. However, the biggest drawback to using the command line is typing commands with long parameter lists.

For example, suppose you're using the Driverquery command to display a list of all the installed drivers on a remote system. Here's how your command line may look:

Driverquery /s server1 /u maindom\hirpln /p p@ssw3d /fo list

If you make one little typo, you'll have to start all over.

The next time you find yourself working from a command prompt, and you know that you'll be repeatedly issuing the same command, save time by creating a Doskey macro using this syntax:

Doskey shortcut=command string

To shorten the command line given above, type the following:

Doskey DQ=Driverquery /s server1 /u maindom\hirpln /p p@ssw3d /fo list

Now you can quickly and easily issue the entire command string by typing DQ. Simply overwrite the computer name, username, and password for different systems.

Editor's Picks