DOS lives! Secrets of the Windows command prompt

Don't be afraid of a little typing. Lots of good old DOS commands still work in Windows, and often they're the best choice for quick and efficient work.

1 2 3 4 5 6 7 8 Page 4
Page 4 of 8

Copying whole directories
On the super-duper level, there is the delightfully powerful, devilishly cryptic ROBOCOPY utility, which comes standard with Vista and is available for download as part of the Windows Server 2003 Resource Kit or the Windows NT Server 4.0 Resource Kit.

No, the ROBO in ROBOCOPY does not stand for robot. It stands for robust. Just as the old XCOPY DOS command was created to fix many of COPY's shortcomings, ROBOCOPY fixes the shortfalls of XCOPY, and makes it smarter.

Primarily, ROBOCOPY is a directory-copying (i.e., folder-copying) tool. It can even mirror a directory tree on a network computer, which can help you resume automatically after a network failure. It's a handy tool for any network administrator, as well as anyone who manually backs up his PC.

The feature set for ROBOCOPY is pretty rich. To get a gander, use the /? switch to see the full list of options and parameters, or just type ROBOCOPY by itself.

Now let's take a look at a ROBOCOPY command:

ROBOCOPY . E:\DAN /MIR

This command directs ROBOCOPY to duplicate, or mirror, the contents of the current directory (abbreviated by the dot) -- and all files and subdirectories in that directory -- to the directory DAN on drive E. All files will be copied. If the operation stops -- it will hang if a file is busy and try it back 1 million times unless you intervene -- you can resume it at any time simply by reissuing the ROBOCOPY command, which will pick up where it left off.

Speaking of those million attempts, a good switch to employ with ROBOCOPY is /R:1. That sets the number of retries for busy files to one rather than the default 1 million. And that way the mirror process doesn't lag because some network service is accessing a log file.

Networking made easy

clear.gif

The command prompt features a host of networking tools, each of which is prefixed by the NET command. You can do pretty much anything on the network at the command prompt that you can do with a mouse in graphics land -- but often faster and easier.

Surveying your network
For example, rather than summon the Network window -- or Network Neighborhood or My Network Places or whatever it's called this month -- you can type NET VIEW at the command prompt and instantly survey the network computer situation.

As you can see in Figure 2, below, the NET VIEW command's output lists each computer on the network, first by network name and second by description.

NET VIEW lists each computer on the network

clear.gif

Figure 2. The NET VIEW command lists each computer on the network by name and description.
clear.gif

 
clear.gif
clear.gif
1 2 3 4 5 6 7 8 Page 4
Page 4 of 8
7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon