• On The Insider: Britney's Bikini-Clad Top 10
January 23, 2009 12:01 AM PST

Getting to know Windows' system commands

by Dennis O'Reilly

Exactly one year ago in this very blog, I promised to describe how to use commands to manage Windows. The earlier post linked to a comprehensive list of system commands on Microsoft's TechNet site.

The problem with the TechNet list is that it's a little too comprehensive. It's easy to lose the very useful ping, ipconfig, and tracert commands among the dozens of obscurities, such as atmadm, nbtstat, and unlodctr. You'll find a much more accessible list at Victor Laurie's site, which includes a page describing commands for renaming, deleting, backing up, and otherwise managing files.

For example, backing up your Documents (Vista) or My Documents (XP) folder to a USB thumb drive is as easy as typing a variation of either of the following lines:

xcopy C:\Users\username\Documents g:\backup /D /E /C /R /H /I /K /Y
xcopy "C:\Documents and Settings\username\My Documents" g:\backup /D /E /C /R /H /I /K

(Swap out "username" with your ID, and don't forget to put the quotes around the file path in XP.)

These examples assume you're using the default location of the folders. Change the drive letter to match that of your USB drive, or whatever device you're backing up the file to. At the end of each command are several switches:

The /D switch ensures that the files being copied are newer than the ones already on the destination device.
The /E switch will copy empty directories and subdirectories.
The /C switch ignores errors.
The /R switch copies over read-only files.
The /H switch copies hidden (system) files.
The /I switch creates directories on the destination device automatically.
The /K switch includes attributes to avoid making all the copied files read-only.
Lastly, the /Y switch gets rid of the prompts when overwriting files.

(My thanks to Victor Laurie's site for help with the switches.)

Open the command window in a flash
The fastest way to get to the command prompt is to create a keyboard shortcut that opens it. My original post covers the steps, but in Vista, you can open a command prompt by pressing the Windows key, typing cmd, and pressing Enter. In XP, click Start > Run, type cmd, and press Enter.

If you were computing in the good ol' DOS days, you may recall such commands as "cd" (to change the directory), "dir" (to view the files in the current directory), and "prn" (to print a file or files). Still, getting to know how to change directories, rearrange files, and perform other system tasks via commands can be a challenge. That's too much information to fit into one blog post.

Fortunately, Lawrence Abrams on Bleepingcomputer.com provides a nice Introduction to the Windows Command Line, even venturing into the area of batch files.

I guess I'll wait until next January 23 to cover batch files, though I'm probably going to need a bigger blog.

Dennis O'Reilly has covered PCs and other technologies in print and online since 1985. Along with more than a decade as editor for Ziff-Davis's Computer Select, Dennis edited PC World's award-winning Here's How section for more than seven years. He is a member of the CNET blog Network, and is not an employee of CNET.
Recent posts from Workers' Edge
Troubleshoot Windows 7 upgrade woes
Browse safely by blocking Web ads
Free alternatives to Adobe Reader
Finding the catch in 'free' software
Remove files attached to messages in Outlook, Thunderbird, and Yahoo Mail
Beat the flu by working remotely
Free disk-imaging utility avoids Windows reinstalls
RoboForm Online secures personal data in 'cloud'
Add a Comment (Log in or register) (6 Comments)
  • prev
  • 1
  • next
by postanote January 23, 2009 9:40 AM PST
You do know, that this is avaialble as a downloadble .CHM (Help File).
Fully explained.

That is not to say theother locations you point to are bad, a bit more layman friendly.

They are fine, but doing reseach on commands via that type of web page is usable but a bit of a chore, especially, when you can get an offline searchable version of the same thing.

'http://www.microsoft.com/downloads/details.aspx?familyid=5FB255FF-72DA-4B08-A504-1B10266CF72A&displaylang=en'
Reply to this comment
by Frank Mlinar January 23, 2009 11:16 AM PST
...and I want to know Windows system commands because?.........
Reply to this comment
by kojacked January 23, 2009 2:33 PM PST
...It gets the Linux guys all excited.
by c|net Reader January 27, 2009 9:25 AM PST
If you're an ordinary end user, you will rarely care. If you write batch/command files to automate tasks, then you might just need on of these commands to do what you want. The xcopy example shown, if captured in batch files, turn a non-trivial drag and drop operation into a double-click (assuming Explorer will copy hidden and system files via drag and drop). Note that Explorer will prompt you -- at least once, depending upon how you answer -- for permission to overwrite read only files. The xcopy commands take care of that once and for all.
by postanote January 23, 2009 6:00 PM PST
No, no, no.

It's Windows Powershell, and Services For Uinx that allows us willing *NIX types excited, and rather pleased, at least a bit more. Not the regular old Windows System Commands, these are still very useful for those who need them. If you don't then it would not matter.

I can manage my *NIX environment from raw *NIX or from Windows using Services for Unix tools and really get into the core on my Windows boxes with Power Shell.

Don't whine about it, if you have not tried it. You'd be suprised.

Well, unless you decide to try and manage a Windows environment say with PERL, PYTHON, or whatever.
Reply to this comment
by c|net Reader January 27, 2009 9:23 AM PST
In XP, use Windows-R to open the Run box, then type "cmd" to load the command interpreter.
Reply to this comment
(6 Comments)
  • prev
  • 1
  • next
advertisement

After 5 years, Firefox faces new challenges

Mozilla helped reshape the Web since releasing Firefox 1.0 five years ago. Now it's got a reawakened Microsoft and Google Chrome to reckon with.

There's a map for that: GPS or smartphone?

Almost every handset comes with mapping software these days, but standalone GPS devices are becoming more affordable than ever.

advertisement

About Workers' Edge

Dennis O'Reilly has covered PCs and other technologies in print and online since 1985. Along with more than a decade as editor for Ziff-Davis's Computer Select, Dennis edited PC World's award-winning Here's How section for more than seven years. He is a member of the CNET Blog Network and is not an employee of CNET.

Add this feed to your online news reader

Workers' Edge topics

advertisement
advertisement

Inside CNET News

Scroll Left Scroll Right