Each DOS command has a mandatory part and some have an optional part. Presented here,
the mandatory parts will be shown in bold CAPITAL LETTERS and the optional parts in lower
case.
For example,
DIR d:pathname\filename.ext /p /w
is the complete command for a disk directory. Note that only DIR is necessary.
You may note the term path name in the above command. The path name is the full
descriptive name to any location on the disk. It includes the names of all directories (see
sub directories later in this section).
In some commands you may use wildcards. A wildcard, like the joker in a card deck, can
stand for any character or group of characters.
The ? represents any single character:
FILE? = FILE1 or FILED etc.
The * represents any group of characters:
*.* = Any file and extension
Use caution with wildcards. They can be dangerous with commands that do things like erase
files. Also, in some cases a wildcard formulation can be misleading. The combination
AP*EX.COM does not mean all files that start with AP and end with EX in their root name and
with a COM extension. It means all files starting with AP and having an extension of COM. The
EX is meaningless as it is ignored because of the asterisk.
Disk Directory
To see a listing of what is on a disk, issue the DIRectory command.
It comes with several options (shown are the most useful, not all).
DIR d:filename.ext /p /w
DIR alone will show the complete directory. With the optional file name, DIR will try to find
just that file.
• The /p option causes a pause when the screen fills.
• The /w option yields a full 80-column display of just the file names.
There are other options for sorting the listing and displaying the contents of lower-level directories.
Now we'll see what would happen when you type DIR at the prompt.
Note several things here.
• DIR tells you what files are on the disk, how big they are, and when they were created.
• DIR also tells how many files total are in the list, how much space those take and what free
space remains.
Three Simple Commands
CLS Clears the screen and puts the cursor in the home (upper left) position.
VER Shows the DOS version number on the video display. You are shown the one-digit version
and two-digit revision:
MS-DOS Version 6.00
VOL d: Displays a volume label, if one exists. The label is a name you have given to the disk when
it was formatted. It is used for identification purposes. (The serial number is put on the disk by the
FORMAT utility.)
Volume in drive C is HANDBOOK
Volume Serial Number is 2C35-16F9
Date and Time
These two commands show and/or set the system date and time.
Early computers relied on you to set the DOS clock during the boot process. In short order
peripheral makers came out with clock cards that, with the helpof a battery, kept a clock going and,
with the help of a program in AUTOEXEC.BAT, loaded the time into DOS for you during boot.
New computers have the clock built-in and do not require a program to load the time.
If your clock battery fails, the default values will be 1-1-80 for the date and 00:00:00.00 for
time. Now and again you will see files with a create date of 1/1/80; they were created on a system
where the clock has failed and DOS has used its default value.
For the DATE command you can enter the date as month/day/year with hyphens or slashes,
i.e., 3/1/94 or 3-1-94 are acceptable dates.
Do not enter the day of the week, even though it shows on the screen. The computer will
calculate it for you. A two digit year assumes dates between 1980 and 1999. In 2000 you will have
to start putting in all four digits.
The format for DATE is:
DATE <date>
On early computers the time setting required a 24-hour clock, i.e., any time after noon had to
have 12 added to it, for example 3:00 pm had to be entered as 15:00. While the TIME command
will still respond to this type of time, you may not also enter 3:00p and the computer is smart
enough to know you mean 15:00.
The format for TIME is:
TIME <time>
On most computers these commands will change the permanent clock settings as well as
changing the date/time in DOS.
Disks straight out of the package need to be formatted, that is have tracks and sectors defined so
DOS can find programs and data on the disk.
The command syntax is below (only the most useful options are shown).
FORMAT d: /s /u
where
• d: defines the disk that will be formatted
• /s puts the DOS system on disk to make it bootable
• /u specifies an unconditional format (can't unformat the disk)
An example:
Problem :Format the disk in drive A: without UNFORMAT information.
Answer :The proper command is:
C>FORMAT A: /U
In order, you are asked to confirm a disk is present for formatting, then told to what capacity
the disk will be formatted (press Control-C to stop the format if this is not correct), then you are
given a report on format progress. At the end you are asked for a volume label (optional) and then
given a report on the success of the format in terms of the number of bytes on the disk. A serial
number is assigned by DOS. It is based on system time and will likely never be the same on two
individual disks.
Additional Comments
Some microcomputers have 1.2 megabyte 5.25" disk drives. There is the temptation to use
360 kilobyte disks in those drives; don't do it. The track width is smaller and if you then put the
360K disks into a 360K drive, they may not work properly. Likewise, you cannot use the high
density floppy disks themselves in 360K drives. The magnetic properties of the disk are such that
the 360K drives won't format them.
With the introduction of 3.5" drives, higher versions of DOS are required to correctly
support the new formats. The 3.5" drives come in two sizes: 720K and 1.4MB.
Unlike the 1.2MB/360K drives disks, it is possible to format to 720K in a 1.4MB 3.5" drive.
All you have to do is tell the FORMAT command the track/sector combination you need:
FORMATA: /F:720 (this tells DOS to format the disk in drive A: to 720K)
Not all versions of DOS support higher capacity disks. For example, DOS 3.2 introduced
support for 3.5-inch disks, but only at 720K format. In order to format a 3.5-inch disk at 1.44MB
you will need DOS 3.3 or later.
the mandatory parts will be shown in bold CAPITAL LETTERS and the optional parts in lower
case.
For example,
DIR d:pathname\filename.ext /p /w
is the complete command for a disk directory. Note that only DIR is necessary.
You may note the term path name in the above command. The path name is the full
descriptive name to any location on the disk. It includes the names of all directories (see
sub directories later in this section).
In some commands you may use wildcards. A wildcard, like the joker in a card deck, can
stand for any character or group of characters.
The ? represents any single character:
FILE? = FILE1 or FILED etc.
The * represents any group of characters:
*.* = Any file and extension
Use caution with wildcards. They can be dangerous with commands that do things like erase
files. Also, in some cases a wildcard formulation can be misleading. The combination
AP*EX.COM does not mean all files that start with AP and end with EX in their root name and
with a COM extension. It means all files starting with AP and having an extension of COM. The
EX is meaningless as it is ignored because of the asterisk.
Disk Directory
To see a listing of what is on a disk, issue the DIRectory command.
It comes with several options (shown are the most useful, not all).
DIR d:filename.ext /p /w
DIR alone will show the complete directory. With the optional file name, DIR will try to find
just that file.
• The /p option causes a pause when the screen fills.
• The /w option yields a full 80-column display of just the file names.
There are other options for sorting the listing and displaying the contents of lower-level directories.
Now we'll see what would happen when you type DIR at the prompt.
Note several things here.
• DIR tells you what files are on the disk, how big they are, and when they were created.
• DIR also tells how many files total are in the list, how much space those take and what free
space remains.
Three Simple Commands
CLS Clears the screen and puts the cursor in the home (upper left) position.
VER Shows the DOS version number on the video display. You are shown the one-digit version
and two-digit revision:
MS-DOS Version 6.00
VOL d: Displays a volume label, if one exists. The label is a name you have given to the disk when
it was formatted. It is used for identification purposes. (The serial number is put on the disk by the
FORMAT utility.)
Volume in drive C is HANDBOOK
Volume Serial Number is 2C35-16F9
Date and Time
These two commands show and/or set the system date and time.
Early computers relied on you to set the DOS clock during the boot process. In short order
peripheral makers came out with clock cards that, with the helpof a battery, kept a clock going and,
with the help of a program in AUTOEXEC.BAT, loaded the time into DOS for you during boot.
New computers have the clock built-in and do not require a program to load the time.
If your clock battery fails, the default values will be 1-1-80 for the date and 00:00:00.00 for
time. Now and again you will see files with a create date of 1/1/80; they were created on a system
where the clock has failed and DOS has used its default value.
For the DATE command you can enter the date as month/day/year with hyphens or slashes,
i.e., 3/1/94 or 3-1-94 are acceptable dates.
Do not enter the day of the week, even though it shows on the screen. The computer will
calculate it for you. A two digit year assumes dates between 1980 and 1999. In 2000 you will have
to start putting in all four digits.
The format for DATE is:
DATE <date>
On early computers the time setting required a 24-hour clock, i.e., any time after noon had to
have 12 added to it, for example 3:00 pm had to be entered as 15:00. While the TIME command
will still respond to this type of time, you may not also enter 3:00p and the computer is smart
enough to know you mean 15:00.
The format for TIME is:
TIME <time>
On most computers these commands will change the permanent clock settings as well as
changing the date/time in DOS.
Disks straight out of the package need to be formatted, that is have tracks and sectors defined so
DOS can find programs and data on the disk.
The command syntax is below (only the most useful options are shown).
FORMAT d: /s /u
where
• d: defines the disk that will be formatted
• /s puts the DOS system on disk to make it bootable
• /u specifies an unconditional format (can't unformat the disk)
An example:
Problem :Format the disk in drive A: without UNFORMAT information.
Answer :The proper command is:
C>FORMAT A: /U
In order, you are asked to confirm a disk is present for formatting, then told to what capacity
the disk will be formatted (press Control-C to stop the format if this is not correct), then you are
given a report on format progress. At the end you are asked for a volume label (optional) and then
given a report on the success of the format in terms of the number of bytes on the disk. A serial
number is assigned by DOS. It is based on system time and will likely never be the same on two
individual disks.
Additional Comments
Some microcomputers have 1.2 megabyte 5.25" disk drives. There is the temptation to use
360 kilobyte disks in those drives; don't do it. The track width is smaller and if you then put the
360K disks into a 360K drive, they may not work properly. Likewise, you cannot use the high
density floppy disks themselves in 360K drives. The magnetic properties of the disk are such that
the 360K drives won't format them.
With the introduction of 3.5" drives, higher versions of DOS are required to correctly
support the new formats. The 3.5" drives come in two sizes: 720K and 1.4MB.
Unlike the 1.2MB/360K drives disks, it is possible to format to 720K in a 1.4MB 3.5" drive.
All you have to do is tell the FORMAT command the track/sector combination you need:
FORMATA: /F:720 (this tells DOS to format the disk in drive A: to 720K)
Not all versions of DOS support higher capacity disks. For example, DOS 3.2 introduced
support for 3.5-inch disks, but only at 720K format. In order to format a 3.5-inch disk at 1.44MB
you will need DOS 3.3 or later.
No comments:
Post a Comment