~DOS Information.

Introduction to DOS Commands and Operating Systems.

A guide written way back in 1989 by Wayne Roberts.  This guide 
was written for DOS 3.3 (not 5 or 6 !!!).  So many of the 
options maybe different, extended or even non-existant.  This 
guide is only for use as basic info on the DOS commands, please 
refer to your DOS HELP for greater info on the commands included 
in your current operating system.  This is done by typing HELP 
at anytime at the DOS Prompt. 


~Introduction.

DOS is the acronym for Disk Operating System.  The operating 
system is a large collection of programs that help with the 
management of the computer's resources.  A disk operating system 
also controls the drives for the storing and loading of programs 
and data. 

Anyone using a computer with at least one disk drive will have 
some knowledge of a Disk Operating System.  What you need to 
know about DOS is roughly what you are going to use the computer 
for.  Commands in DOS range from simply formatting a disk, 
copying and erasing files, getting a directory of files and 
executing of files. 

When you first start using DOS you only need to know the basic 
functions of the DOS commands that you are going to use the most 
often.  As time goes on you can learn the commands in greater 
detail. 

Below is a list of DOS commands that I think are used the most 
often and are more useful in a working situation within the 
college. 


~ASSIGN

This command is used to assign a drive of a certain letter to be 
equal with another drive letter eg. If you have a 5.25" disk 
drive and a 3.5" drive you can swap the letter of the drives 
across making one drive a: whilst making the other b:  

ASSIGN A: = B:


~CD / CHDIR

Allows the user to change from current directory to another 
directory. 

CD C:\WINDOWS\EXCEL\USER


~CHKDSK

Checks a disks directory and file allocation table (FAT).  Also 
reports a status, which includes disk space available, disk 
spaced used, bad sectors etc and can also be used to repair 
errors in the directories or FAT. 

CHKDSK a: (Check floppy drive).


~CLS

Clears the whole of the display screen.



~COPY

Copies one or a selection of files one drive in a particular 
directory to another directory either on the same drive, or 
another, into a different directory or the same.  Files can also 
be copied into each other. 

Eg.

COPY A:\WORD\WORK.DOC C:\TEMP
COPY C:\TEMP\*.* C:\GAMES

Example of copying a file from floppy disk to another directory 
on hard disk. 


<A:\WORD>copy dos_one.doc C:\temp
        1 File(s) copied

<A:\WORD>


~DATE

Allow user to view, change the system date.

Eg.

DATE 26-09-89


~DEL

Allows a user to delete file(s) on an allocated drive and/or 
directory. When stating the wild card "*.*" you will be prompted 
with a message that asks you if you are sure that you wish to 
delete everything in that directory. 

DEL C:\GAMES\*.*

Example of deleting a file from a directory on the hard disk.


<C:del c:\temp\dos_one.doc

<C:



~DIR

Lists any or all filenames and sub-directories in a particular
directory.

DIR A:\WORD\EXERCISES

Example of a Directory using DIR.

<A:\EXCEL>dir

 Volume in drive A is WAYNE-WORD
 Directory of  A:\EXCEL

.            <DIR>     21-11-88    1:59p
..           <DIR>     21-11-88    1:59p
ACCOUNTS  XLS      4280 09-12-88    9:48a
CHART     XLC      2446 09-12-88    9:28a
CMONITOR  XLS      7018 20-03-89   10:02a
CSPRINT   XLS      3226 20-01-89   11:01a
DOTMATRX  XLS      3317 10-01-89   10:01a
FORM      XLS      7948 08-05-89    2:59p
INVOICE   XLS      6585 08-05-89    3:28p
IP        XLS      9799 09-12-88    1:19p
LASER     XLS      4473 26-01-89   11:48a
LOGIC     XLS      3440 09-12-88    3:38p
MMONITOR  XLS      5591 16-03-89    2:35a
PIASTATE  XLS      3822 25-05-89   11:56a
STATEMNT  XLS      5663 10-05-89    2:42p
TREND     XLS       958 20-06-89   11:58a
TREND     XLC      6257 20-06-89    3:20p<+
   |   17 File(s)   | 425984 bytes free   |
   ++      ++       |       |             |
(Filename)(Exten) (Size)(Date Created)(Time)


~FORMAT

Initialises the disk to accept DOS information and files.  The 
command also checks for defective tracks and optionally place 
DOS on the disk. Using various options you can format the disk 
to various types 

eg. FORMAT d:  - formats a floppy to 720  KBytes.
    FORMAT a:  - formats a floppy to 1.44 Mbytes.
    FORMAT /1  - formats a floppy single sided.

DO NOT TYPE FORMAT or FORMAT C: WHILST USING THE HARD DISK.

Example of using the format command.

<C:format a:

Insert new diskette for drive A:
and press ENTER when ready...

Format complete

   1457664 bytes total disk space
   1457664 bytes available on disk



~MD / MKDIR

Creates a new directory or sub-directory.

Example.

<C: MD WAYNE

<C: CD WAYNE (CD - Change directory see CD)

<C:\WAYNE>


~PATH

Typing the command path at the prompt will display the path the 
machine is currently set up to look in.  If file is not found in 
one directory it searches in the next directory defined in the 
path.  Path is set up in the AUTOEXEC.BAT of the computer. 

Eg.

   PATH = C:\;C:\WORD;C:\EXCEL;C:\GAMES;

Typing PATH will give the above message.

If you have a program called JUMP.EXE in directory C:\GAMES and 
you type JUMP in the root it will search through the root, WORD, 
and EXCEL directories first before finding the right program. 


~PRINT

Prints a list of files on the printer, while the computer 
performs other tasks. 

Eg.
   PRINT A:\WORD\TESTDOC.DOC


~PROMPT

Often set up again in the AUTOEXEC.BAT, but can be changed at 
any time whilst using DOS. 

Eg.
   PROMPT $L$P$G$  will produce <(current directory)>  <C:\temp>


~REN / RENAME

Changes the name of a file/files on disk.

Eg.

  REN a:\filee.txt a:\file



~RD / RMDIR

Removes a subdirectory, which must be empty of any files or 
other directories. 

Eg.

   RD GAMES


~TIME

Displays or enables you to set the current system time.

Eg. TIME hh:mm:ss:xx   16:32:01


~TYPE

Display the contents of a file to the screen.

Eg.  TYPE A:\TRIAL.TXT


~VER

Shows the DOS version number to the screen.

Example of using VER command with DOS 4.0.

<C:VER

IBM DOS Version 4.00

<C:



~What is an INTERNAL DOS command ?

In internal DOS command is a program built into the command.com 
of your MS-DOS disk.  This means when typing in the command you 
may be in any directory and you will not have to state where to 
find the command.  But with external commands you have to set up 
the path so as the computer can find the command and external 
commands can be deleted. 

Examples of some Internal DOS command.

CD / CHDIR - Change directory.
MD / MKDIR - Make directory.
TYPE       - Type file to screen.


~Execution of commands.

The priority of executing programs is very important.  If you 
have more than one program in the same directory it will execute 
them in a certain order, shown below :-

               .COM file first
               .EXE file second
               .BAT file third

Eg. If three files TEST.COM, TEST.EXE and TEST.BAT are in the 
same directory and TEST is typed, then TEST.COM will be 
executed. 

To execute a program called TYPE.COM you would have to rename it 
to another name as in DOS there is an internal command called 
TYPE. If TYPE was entered at prompt it would execute the DOS 
TYPE command not the TYPE.COM file.  To rename the TYPE.COM 
other filename type :-

REN TYPE.COM <new name>  in directory with file.


~Use of MV command in ROOT Directory.

The use of the MV (MOVE) command anywhere on disk and especially 
with wild cards (*'s) and even more in the root directory of the 
hard disk. This is because the MV function as well as copying 
the file removes it from it old position on the disk 
automatically. 

In the ROOT directory of the hard disk there are two files 
called "IBMBIO.COM" and "IBMDOS.COM" which are put on a 
particular part of the disk, if they are deleted or moved then 
the hard disk will not work properly next time it is re-booted.  
So if you type MV *.* in the root directory you might as well 
say goodbye to programs stored on the disk which you are enable 
to copy off and then type "FORMAT C:". 


~Introduction to UTILITIES.

There are many utility programs available today on the software 
market in our computer centre we have six different utility 
program these being PC-TOOLS, PCSHELL, Q-DOS, DOSSHELL, and the 
less used Xtree and Norton Utilities.  Within the computer 
department we all have our own personal preferences, PC-TOOLS 
being mine. 

Utility program are mainly used for maintenance of disks 
including deleting, undeleting, compression, sorting, viewing, 
editing etc.. of various files and/or directories. 

The next few pages will show how files can be examined, hidden, 
have their attributes changed etc.. using PC-TOOLS. 

The opening screen to PC-TOOLS after typing "PCTOOLS" at prompt. 

By pressing any key at the opening screen you will go straight 
into the file functions part of PC-TOOLS which shows all the 
files in the current directory. 



~Editing or viewing a file.

To edit a file in PC-TOOLS all you have to do is select the file 
that you wish to edit by moving the highlight bar over the file 
and press return.  When selected (should have a number next to 
it) press 'E' to edit.  You will then be faced with an editing 
screen which includes the options at the bottom of the screen 
and the file which you are editing in the rest of the screen.  
Pressing F3 to edit the file. 



~Hiding files and/or changing their attributes.

To hide or change a files attribute using PCTOOLS you need to 
select the file to be changed by moving the highlight bar above 
it and pressing return.  By selecting 'A' for Attribute you will 
then go into a separate screen for editing the attribute of your 
selected file.  Shown below is a screen dump of the attribute 
edit where the files attribute is being changed so as the file 
becomes hidden. 


Other attributes of the file can be changed just as easily 
following instruction given on the screen.  These instructions 
are very clear to follow and even a novice can come along and 
change the attribute. 


~Hiding a directory using PC-TOOLS.

All files in MS-DOS are made up of a series of numbers called 
attributes.  To alter the structure of a file you simply change 
the numbers but only change the numbers if you know what you are 
doing else you may corrupt the file or directory.  One number 
refers specifically to the attribute of the file or directory 
and changing this does the same as in above paragraphs but for 
directories as well. 

For example to hide a directory all you need to do is type F3 
for other menu (whilst in file functions), then type 'E' for 
edit, F2 to change sector, 'R' for root, then move down to the 
file attribute and change it as shown overleaf. 



~The Disks and the Operating System.

Obviously as the operating system is called DISK Operating 
System then disks and disk drives are your computer system's 
most important peripherals.  The Keyboard, and VDU are just 
useful input and output devices.  Whereas Printers and Modems 
extend the capability of your system.  The disk drives allow the 
computer to store and retrieve large amounts of information. 

Information stored in RAM (Random-Access Memory) is temporary as 
when the computer is turned off it disappears, whereas 
information stored on disk stays until changed or deleted. 

The floppy disk is a very fragile piece of equipment able to 
store over 360,000 + characters.  The care of the disks and the 
files on them needs to be taken properly.  Files on the disk 
need to be kept in a tidy order (kept in directories etc.) and 
the disk itself needs to be compressed (a utility used within 
PC-TOOLS) regularly so as files are sorted out properly on the 
disk surface and all bad clusters are deleted. 

Floppy drives also need to be cared for.  As they are open to 
the atmosphere dust, dirt etc tends to get within the drive and 
heads can become dirty.  So regular cleaning with a disk 
cleaner. 


~Use of Switches and flags in a DOS command.

What is a Switch ? - Most DOS commands have options that affect 
the way the command works.  To use the switch options, you must 
"pull the switch" when you use this command.  When you pull the 
switch you tell this command to do extra work or handle the 
command in a different way. Most DOS commands have switches.  
Typing a forward slash (/) and the appropriate switch letter 
will operate the switch.  The switch is often typed at the end 
of the command. 

What is a Flag ? - A flag is similar to a switch but is not part 
of the command being used, it is an option used as an extra to 
options built into the command.  The flag often being the 
location of the file. 

Examples of switches and flags.

FORMAT /s - Formats a disk with system files on it.
DIR /W -    Wide directory listing.
DIR /P -    Directory listing with pause when screen full.
DIR a: -    Directory of floppy disc.


~Some common DOS commands.

Below is another list of commonly used DOS commands, that have 
been explained in Task One but are explained here in greater 
detail. 

The following abbreviations are used in the following section :-

     d:    - For drive letter.
     path\ - Directory path for filename.
     .ext  - For extension used.


PRINT - Is a command used to print a disk file while another 
program is running.  Print is a very primitive way of 
multi-tasking (a way of running more than one program at a 
time). 

Print will print the contents of a file to the printer a non 
ASCII text file will probably contain a great deal of control 
codes which may turn you r printer crazy when printed out.  
Printing them use PRINT is exactly the same as using the TYPE 
command but you get a hard copy of the contents. 

The syntax of the PRINT command :-

     PRINT d:filename.ext /T/C/P...

The three switches are optional but the /P option is the default 
if neither of the others is typed.  These switches do the 
following :-

               /T Terminate, stop printing
               /C Cancel the printing of a file
               /P Print this file

The ... referred to above in the syntax refers to any other 
flags or switches which the user wishes to use. 


RENAME / REN - allows you to change the name of a file.  DOS 
will accepteither version of the command.  The syntax of the 
RENAME command is :-

     RENAME d:path\oldfilename.ext newfilename.ext

The oldfilename being the name of file to be renamed and the 
newfilename being the name for it to be changed to. 

The path need not be given if the filename is in the current 
directory. DOS protects itself from having to files of the same 
name, an error message is given if a file is being renamed as a 
file that already exists. 

RENAME does not touch the contents of a file it only changes the 
name assigned to it.  Be careful when renaming files that you 
don't rename it so as a program does not find it when execution 
is in progress. 

CHKDSK - Checks the directory and file allocation table (FAT) of 
the disk and reports disk and memory status.  Also able to 
repair errors in the directories or FAT. 

The syntax of the CHKDSK command is :-

     CHKDSK d:\filename.ext /F/V

The switches F and V do the following :-

          /F Fixes the File Allocation Table, if errors are found.
          /V Shows CHKDSK's progress and more detailed information
             about the errors it finds. (Verbose) 

Examples of the use of CHKDSK.

a) CHKDSK - analyzes the disk or diskette in the current drive.
b) CHKDSK A: - analyzes the diskette in a:
c) CHKDSK A:/F - analyzes the diskette in a: and asks permission to
   repair the FAT if a flaw is found.

Example output from a CHKDSK command.

<C:chkdsk

Volume 5740544     created 02-10-1989 2:39p

  21170176 bytes total disk space
     81920 bytes in 5 hidden files
     51200 bytes in 21 directories
  18251776 bytes in 670 user files
     20480 bytes in bad sectors
   2764800 bytes available on disk

      2048 bytes in each allocation unit
     10337 total allocation units on disk
      1350 available allocation units on disk

    655360 total bytes memory
    471504 bytes free



FORMAT - Initializes the disk to accept DOS information and 
files.  Thecommand also checks the disk for defective tracks and 
optionally places DOS on the disk. 

The syntax of FORMAT command is :-

     FORMAT d: /O/V/S

The three switches doing the following :-

        /O Formats an 8-sector diskette and leaves the proper 
           places in the directory for the operating system, but 
           does not place the operating system on the disk.

          /V Write a volume label on the disk.

          /S Places on the disk a copy of the operating system, 
             which makes the diskette bootable (able to reset 
             machine on it).


Using PCFORMAT (Formatter with DOS 4.0) you are able to format 
using other options (Shown Below). 

<C:pcformat a: /h

PC Tools Disk Formatter v4.11

The PCFormat options are:

/V     Add volume label
/S     Include DOS; make it bootable
/TEST  Simulation; disk isn't written
/1     Single-sided
/4     360k disk in 1.2 Meg drive
/8     8 sectors per track
/N:ss  Sectors per trk (8,9,15,18)
/T:tt  Tracks (40,80)
/F     Reformat & rewrite entire diskette
/DESTROY  Format & erase diskette

See part one for an example of the FORMAT command.


PATH - Sets up the path for DOS to search the specified 
directories on the specified drives if a program or batch file 
is not found in the current directory.  The path is usually set 
up in the AUTOEXEC.BAT and is usually formatted in the following 
way :-

     PATH= C:\;C:\DOS;C:\UTILITY;C:\WORD5;C:\ORACLE;C:\GAMES;

When a command is typed and the current disk drive name is not 
given DOS will search the current drive directories.  If the 
file is not found int the current directory and the other given 
directories an error message will occur. 



PROMPT - Allows the user to set up the system prompt to his/her 
desired format.  The prompt being <A: or <C:\DOS. 

The syntax of the prompt command being :-

     PROMPT promptstring

The promptstrings available are as follows :-

`      Character               What it Produces

`          $                   $, the dollar sign
`          _ (underscore)      Carriage return, move top next line.
`          b                   |, vertical line
`          e                   The escape character
`          d                   Date
`          h                   Backspace
`          g                   >, greater than sign
`          l                   <, less than sign
`          n                   current drive
`          p                   the current drive and directory
`          q                   =, equal sign
`          t                   Time
`          v                   Dos Version

`     All others               Nothing or null, ignored


Examples of the PROMPT command.

1) PROMPT - a: or c: (normal prompt)

2) PROMPT The current Drive is $n: - The current drive is a:

3) PROMPT $p - A:\WORD5\TEMP (Current directory)

4) PROMPT $l$p$g - <C: (Prompt used in computer centre)


TYPE - This command allows a user to display the contents of a 
file to the screen.  Works in exactly the same way as the PRINT 
command but does not print the file onto paper unless CTRL-P or 
by adding "> PRN" at the end of the command. 

Syntax of the TYPE command.

     TYPE d:path\filename.ext


DOS is a very large and comprehensive operating system and as 
explained is an essential part of a computer system.  DOS can be 
easy for many people to learn but others may struggle.  Probably 
the easiest way of learning DOS is to experiment with various 
files on your floppy disk.  Expermenting on the hard disk is not 
recommended as you may corrupt files or programs essential to 
the hard disk.   

Happy DOSsing.
