Naming Things in DOS
Microcomputer/DOS Tutorial


Computer Studying

Navigation
{NavForms}

Virus Tutorial Map
Tutorial Map

Everything that DOS interacts with has a name and the names have certain rules that have to be followed. Let's look at some of them.

Default Drive

The default drive is the first disk drive on which DOS will look for a program if no drive specification is given with the filename.

How do you know what it is? Look at the prompt. The default drive letter is part of the prompt (unless someone has changed the prompt to eliminate it).

A:\> indicates that drive A (the left or top drive in a two-drive system) is the default drive. The right (or second) drive in such a system is called drive B and the first hard disk in any system is given the letter C as its drive designation.

DOS supports many more than drives A through C. In fact, if your computer has them you can specify up to 63 drive names. (This is a "Catch 22" situation. DOS can respond to 63 drive names but converts all lower case to upper case automatically so you really can't access 63 devices.) You change drives by typing the desired default drive followed by a colon at the prompt. To change to drive C type C: as shown here:

A to C drive change

Device Names

Character oriented devices can be addressed by DOS through their names:

  • CON: The name for the video display and keyboard.
  • AUX: or COM1: This is the first asynchronous communications port which usually has a modem or other serial device connected to it. The second communications port is COM2:
  • PRN or LPT1: The first parallel printer port. PRN comes from printer and LPT is an old designator derived from line printer. A colon on PRN and all device names is optional in later DOS versions. The second parallel port is LPT2:
  • CAS1: A holdover; this is the cassette recorder port.
  • NUL: This is a test device. Anything sent to device NUL: goes into the bit bucket (i.e., gets thrown away).

Rules for Filenames

Like devices, disk files have to be identified so DOS can address them. These filenames have specific rules.

The basic form of a filename is:

Filename.ext

The first part of the name to the left of the period is called the root name. The root name can be from one to eight characters long and cannot be the same as a device name. The second part to the right of the period is the extension. It is optional and, if used, can be one to three characters long.

The period is used between the root name and extension and must be present if there is an extension.

The following are legal and illegal characters in a filename:

  • Legal: A-Z 0-9 $#&@!()-{}'`_~
  • Illegal: |<>\^+=?/[]";,* plus control characters and the space

Some other operating systems allow longer file names and there are commercial utilities which link a database of long names to your short names so you can find files by using more fully descriptive names.

[Note: Windows allows longer file names with the space but underneath the facade the 8.3 format is maintained.]

Keep Reading Command Format


{NavBar}
Home | Products | Definitions | Newsletter | Virus Tutorial | Contact


FILExt is proudly hosted by DewaHost.com - a fast and reliable host for everyone!
DewaHost offers premium Web hosting starting from $8.95/month and a high speed file hosting service FileBurst!

Please use the contact form for questions or comments about this web site.
Copyright © 2001 Computer Knowledge, All Rights Reserved
Pray the Rosary for peace.