Alan Freedman -- The Computer Language Company - Computer Desktop Encyclopedia
Computer Desktop Encyclopedia
Longest-Running Tech Reference on the Planet

A CDE Definition

You'll love The Computer Desktop Encyclopedia (CDE) for Tech Term of the Day (TTOD)


DOS directories

The disk folder system in DOS. Although folder names and contents differ, the Windows folder structure is the same as DOS. See cmd folders.

cmd folders

This follow-up to "cmd abc's" shows you how to switch between folders on the DOS/Windows command line. In "cmd abc's," you learned that a file/folder hierarchy looks like an organization chart such as the following. See cmd abc's.

The Basics
The command prompt displays the "default folder." When a command is executed, all files referenced are assumed to be in the default folder. If a file is in a different folder, the command must include the folder name with the file name. In the following example, the command prompt is currently set to the AA folder, and the first command references AA by default. Without changing the command prompt, the second command uses an explicit reference to the BB folder (the \bb\):

 1 - Implicit Reference to AA Folder

   C:\AA>dir *.gif       all GIFs in AA

 2 - Explicit Reference to BB Folder

   C:\AA>dir \bb\*.gif   all GIFs in BB

Folders can be created off the root or within other folders any number of layers below. These are technically "subfolders" or "subdirectories," but the term "folder" is commonly used to refer to a folder at any level.

The only tricky part to remember is that there is different syntax if you want to go back "up the tree" or "down the tree."

This example creates a JANINE folder within the default ABC folder. When switching to JANINE, there is no backslash in the syntax (this is important):

  C:\ABC>md janine   create JANINE folder
  C:\ABC>cd janine   go to JANINE folder
  C:\>ABC\JANINE>    prompt changes

To go to a folder at the same or higher level, the backslash is used. This example creates a JANINE folder inside the XYZ folder, which is at the same level as the default ABC folder:

        C:\ABC>md \xyz\janine

Suppose therea are three folders in the PLANS folder:


If the default is 2010, and you want to go to 2012, there are two ways to do it:

  C:\PLANS\2010>cd \plans\2012


  C:\PLANS\2010>cd ..   (..) up one level
  C:\PLANS>cd 2012      go to 2012**

**Remember. No backslash (\) when you go down the tree.

When switching between folders on different drives, switch drives first. For example, to switch from C:\PLANS\2010> to D:\BUDGETS>, type:

  C:\PLANS\1991>d:   switch drives
  D:\>cd budgets     switch folders
  D:\>cd bud*        (*) a shortcut
  D:\BUDGETS>        prompt changes


Folder Rule #1
When going to a folder on a different drive, change drives first, then change folders.

Folder Rule #2
The backslash represents the root folder. It is also used as a separator symbol between folder and file names.

Folder Rule #3
When using the CD command to go to a folder on the same or previous level, the path name must begin with the root (\).

Personal Use Only

Before/After Your Search Term
DOS 7DOS environment
DOS abc'sDOS error messages
DOS AppendDOS extender
DOS AssignDOS file
DoS attackDOS Interlink
DOS Backup/RestoreDOS macros
DOS batch fileDOS memory manager
DOS boxDOS Mirror
DOS commandDOS on Mac Card
DOS device namesDOS prompt

Terms By Topic
Click any of the following categories for a list of fundamental terms.
Computer Words You Gotta KnowSystem design
Job categoriesUnix/Linux
Interesting stuffPersonal computers
InternetIndustrial Automation/Process Control
Communications & networkingAssociations/Standards organizations
HistoryDesktop publishing
ProgrammingHealthcare IT
System design