Tips from the Windows Pros: Using Command-Line Utilities


Setting up a new network can be a grueling task. If you've ever set up a dozen computers in a day, you know what I mean. Think how long it took you to set up Windows, install applications, set up printers and network information, and get the desktop just so… then multiply that work by 10 or more. Then repeat the process anytime a new computer is installed, or repaired and reformatted.

Network managers do anything they can to minimize the amount of work they need to do to set up and maintain computers. Windows 200x Server offers a remote installation service that can set up a completely outfitted Windows XP workstation in a virgin computer, over the LAN, without laying a finger on it. This is a blessing for them, but what about those of us with peer-to-peer workgroup LANs?

The rest of us rely on whatever handy labor-saving tricks we can find to minimize the amount of work needed. Batch files can go a long way to help ease the pain of installing, and they also have two other benefits: They let you make more consistent installations, and they serve as a sort of documentation of whatever configuration they're performing.

My first tip to a workgroup manager is to learn the Windows XP command-line utilities; you can set up batch files to make some consistent settings on new computers. It doesn't hurt to learn how to use Windows Scripting Host. And, the Windows XP Resource Kit offers a big pile of extra command line utilities. Every network manager should have a copy of the resource kit.

Put any batch files and scripts you develop in a shared network folder, and you'll have an installation and configuration toolkit. If a user accidentally disconnects a mapped network drive, that person can visit your folder of handy icons, click MAPDRIVES, and everything can be reset. This can be done with net use commands in a batch file.

You can also install printers with the command line. The entire functionality of the Install Printer Wizard is available at the command line; you can pop up graphical utilities like the queue manager, and you even can perform installations and configure printers in a batch file.

Type the following at the command prompt for a full listing of the printer configuration utility's commands:

 rundll32 printui.dll,PrintUIEntry /? 

Scroll to the bottom of the list for an eye-popping list of examples. (I warn you, it's ugly. Some experimentation is required to get some of the commands to work, even with the examples given here.)

One really handy use of this command is to install a connection to a network shared printer. This example sets up the local computer to use the shared printer \\bali\laserjet:

 rundll32 printui.dll,PrintUIEntry /n "\\bali\laserjet" /in rundll32 printui.dll,PrintUIEntry /n "\\bali\laserjet" /y 

The first command installs the printer, and the second makes it the default printer.

If you put commands like these in a batch file (using your network's printer names, of course) and put the batch file in a shared network folder, you can add the printer(s) to any computer just by double-clicking the batch file icon. This capability can be a real time-saver when you're configuring many workstations. You could also put these commands in a common login script batch file on your network so that they are executed when your users log in.



Special Edition Using Microsoft Windows XP Professional
Special Edition Using Microsoft Windows XP Professional (3rd Edition)
ISBN: 0789732807
EAN: 2147483647
Year: 2003
Pages: 450

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net