Dealing with DOS - Part 2


Following on from last week's article about DOS commands, this week takes a look at some DOS commands that are useful - especially if Windows doesn't load and you are trying to get it working again (or rescuing data prior to a reformat!)

Change Drive

The change drive command allows you to switch from one drive to another. If you have had to reboot your machine using a start-up disk, you may find that your prompt looks like A:\>. This means that any directory commands will be aimed at your A drive. To change drives, type the letter of the drive followed by a colon ":". So C: will change to your C: drive.

The CD - Change Directory (Folder) Command

The CD command allows you to navigate around your disks. The files on your computer are stored in directories (or folders if you use Windows parlance). Within a directory, other directories can exist so forming a hierarchical structure that contains the files.

Use CD followed by a directory to change to that directory. You would do this to perform operations on your files (such as copying files from one directory / drive to another). The argument to the CD command can take one of two forms. It is known as a path and this can be a relative or a full path.

What's the difference? A full path will always start with the \ character which is used to separate the name of one directory from another. For example, here is a full path.

\WINDOWS\SYSTEM You can also type in the drive letter as well with a full path (C:\WINDOWS\SYSTEM). A full path is taken from the "top" of a drive, that is, the uppermost directory which is known as root. If you wish to change to the root drive of a disk, enter CD \.

Note: DOS commands are NOT case sensitive so you can type them in upper or lowercase. I will use uppercase in this article to help identify the commands.

A relative path is a path that will only work depending on your current position on a disk. For example, suppose I had a directory.

C:\MY DOCUMENTS\BUSINESS\PC SUPPORT If I was currently in the "BUSINESS" folder, I could use the following command to change to the PC SUPPORT directory. Here's the command

CD PC SUPPORT

Notice that a relative path NEVER starts with the \ character. If I was not is the BUSINESS directory and I did NOT have a folder called PC SUPPORT beneath my current directory, the command will fail. Relative paths are useful when you want to work in a localised area of your disk, but sometimes it's quicker to use a full path.

The copyright of the article Dealing with DOS - Part 2 in PC Support is owned by Chris Cruickshank. Permission to republish Dealing with DOS - Part 2 in print or online must be granted by the author in writing.

Go To Page: 1 2 3

Articles in this Topic    Discussions in this Topic