Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Lab – DOS COMMANDS

Objective
The following assignment is designed to introduce the student to some DOS commands,
assist the student in creating a DOS bootable disk, and using the Editor to create and/or edit
the necessary AUTOEXEC.BAT and CONFIG.SYS files.

Materials Required

• DOS operating system


• A blank unformatted floppy disk

Activity Background

MS-DOS stands for Micro Soft Disk Operating System. It was the first operating system used
on the original IBM PC. Because the IBM PC became the standard for personal computers,
DOS became the standard for operating systems. The introduction of new graphically oriented
operating systems such as Windows has made DOS an obsolete Operating System; however,
DOS still exists on many machines and the PC technician will be called on to fix those
machines. In addition, fixing many of the problems in the newer operating systems requires
booting to a command prompt and using DOS or DOS-like commands which are available
within Windows OS.

DOS is a command driven operating system. Commands must be typed in exactly the way
DOS expects them to be. Compared to other operating systems, DOS is small and easy to
use and understand… once the user has become familiar with a few commands.

It is very unlikely that as either a user or a technician you will be required to install a full
version of DOS on a PC but, if you must, it is a relatively easy task. The last release of
DOS, version 6.22, comes on three diskettes, simply insert the first diskette in the floppy
drive and reboot the system, the installation starts automatically.

If the hard drive has already been partitioned and formatted then simply follow the on-
screen instructions and complete the installation using the default options that the
installation routine recommends.

If the hard drive has not been partitioned and/or formatted, then abort the installation process
(by selecting “EXIT” when prompted by the installation routine) and, using the same diskette
#1, partition the hard drive using the FDISK command and then format it using the FORMAT
command with the “/S” option to make it bootable.

1
It is very likely, however, that the technician will need a DOS bootable diskette to boot into
a corrupted Windows based system in order to fix it. This lab will guide the student through
the steps needed for creating a DOS bootable diskette.

DOS COMMANDS and MAKING A RESCUE DISKETTE

Note to the student

In this and any other lab, please write or print answers clearly. The instructor will not attempt
to interpret gibberish. If it’s not easily readable by the instructor, it will be marked wrong. No
exceptions and no changes will be made once the grade has been assigned. Please comply
with this simple request.

Supplemental Material

Following are the MS-DOS Internal and External commands together with a brief description.
This list can be used to select the appropriate DOS command to perform a specific function.
To obtain detailed information on the usage of any one command, use the Help command;
for example, to obtain information on the APPEND command, type the following at the DOS
prompt: Help append

The list of commands shown below was obtained using the DOS command “FASTHELP”. The
DOS commands in bold text are those that the user is most likely to need and use.

DOS
Description
Command
Allows programs to open data files in specified directories as if they were
APPEND
in the current directory.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the active code page number.
CHDIR Displays the name of or changes the current directory.
CHKDSK Checks a disk and displays a status report.
CHOICE Prompts the user to make a choice in a batch program.
CLS Clears the screen.

2
COMMAND Starts a new instance of the MS-DOS command interpreter.
COMP Compares the contents of two files or sets of files.
COPY Copies one or more files to another location.
Changes the terminal device used to control your
CTTY
system.
DATE Displays or sets the date.
DBLSPACE Creates and manages drives compressed by using DoubleSpace.
DEBUG Starts Debug, a program testing and editing tool.
DEFRAG Reorganizes the files on a disk to optimize the disk.
DEL Deletes one or more files.
DELOLDOS Deletes the OLD_DOS.1 directory and the files it contains.
DELTREE Deletes a directory and all the files and subdirectories in it.
DIR Displays a list of files and subdirectories in a directory.
DISKCOMP Compares the contents of two floppy disks.
DISKCOPY Copies the contents of one floppy disk to another.
Edits command lines, recalls MS-DOS commands, and creates
DOSKEY
macros.
DOSSHELL Starts MS-DOS Shell.
DRVSPACE Creates and manages drives compressed by using DriveSpace.
ECHO Displays messages, or turns command echoing on or off.
EDIT Starts MS-DOS Editor, which creates and changes ASCII files.
EMM386 Enables or disables EMM386 expanded memory support.
ERASE Deletes one or more files.
EXIT Quits the COMMAND.COM program (command interpreter).
EXPAND Decompresses one or more compressed files.
FASTHELP Provides summary Help information for MS-DOS commands.
Decreases the amount of time needed to open frequently used files and
FASTOPEN
directories.
Compares two files or sets of files, and displays the differences
FC between them.
FDISK Configures a hard disk for use with MS-DOS.
FIND Searches for a text string in a file or files.
FOR Runs a specified command for each file in a set of files.
FORMAT Formats a disk for use with MS-DOS.
GRAPHICS Loads a program that can print graphics.
Provides complete, interactive Help information for MS-DOS
HELP commands.
INTERLNK Connects two computers via parallel or serial ports.
INTERSVR Starts the Interlnk server.
KEYB Configures a keyboard for a specific language.

3
LABEL Creates, changes, or deletes the volume label of a disk.
LH Loads a program into the upper memory area.
LOADFIX Loads a program above the first 64K of memory, and runs the program.
LOADHIGH Loads a program into the upper memory area.
MD Creates a directory.
MEM Displays the amount of used and free memory in your system.
Starts the Memmaker program, which optimizes your computer's
MEMMAKER
memory.
MKDIR Creates a directory.
MODE Configures a system device.
MORE Displays output one screen at a time.
MOVE Moves one or more files. Also renames files and directories.
MSAV Scans your computer for known viruses.
MSBACKUP Backs up or restores one or more files from one disk to another.
MSD Provides detailed technical information about your computer.
NLSFUNC Loads country-specific information.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a message.
POWER Turns power management on and off.
PRINT Prints a text file while you are using other MS-DOS commands.
PROMPT Changes the MS-DOS command prompt.
QBASIC Starts the MS-DOS QBasic programming environment.
RD Removes a directory.
REN Renames a file or files.
RENAME Renames a file or files.
REPLACE Replaces files.
RESTORE Restores files that were backed up by using the BACKUP command.
RMDIR Removes a directory.
SCANDISK Checks a drive for errors and repairs any problems it finds.
SET Displays, sets, or removes MS-DOS environment variables.
SETVER Sets the version number that MS-DOS reports to a program.
SHARE Installs file-sharing and locking capabilities on your hard disk.
SORT Sorts input.
SUBST Associates a path with a drive letter.
Copies MS-DOS system files and command interpreter to a disk you
SYS
specify.
TIME Displays or sets the system time.
TREE Graphically displays the directory structure of a drive or path.

4
TYPE Displays the contents of a text file.
UNDELETE Restores files previously deleted with the DEL command.
UNFORMAT Restores a disk erased by the FORMAT command.
VER Displays the MS-DOS version.
Directs MS-DOS to verify that your files are written correctly to a
VERIFY
disk.
VOL Displays a disk volume label and serial number.
VSAFE Continuously monitors your computer for viruses.
XCOPY Copies files (except hidden and system files) and directory trees.

1. PRACTICING BASIC DOS COMMANDS

In the procedure that follows, for those step requiring a DOS command, the command may
be given, in which case it will be shown in bold and within brackets; for example [dir *.]. Type
the command exactly as shown, but without the brackets, then press “Enter”. DOS
commands are not case sensitive, so they can be entered in either upper or lower case.

1. Follow the instructor’s instructions to load a clean copy of the MS-DOS Operating
System.

2. It is sometimes useful to know only directories (or folders) that are available on the drive.
This can be accomplished using the DIR command. Type [dir *.].

3. Record all the directories shown:


1) _________________, 2) _________________, 3) _______________ 4)
_________________, 5) _________________, 6) _______________

4. Change directory location, move into the DOS directory. [cd \dos]

5. The prompt should now show the name of the directory you reside in. What is the prompt
shown ____________________.

6. Obtain a directory listing of all the files in the DOS directory. [dir]

7. Did you notice that the listing scrolls off the top of the screen! You can control that by
using the page option with the DIR command. Type the command [dir /p], the listing
will stop when one screen is full. Press any key to list the next page. Continue until all

5
files have been displayed, the DOS prompt will then appear.

8. Type the following command [dir /w]. The option /w stands for wide.

9. Finally, the two options can be combined. [dir /w /p]

10. Move back to the root directory. [cd \]. What is the prompt shown now?
____________________ .

11. Move into one of the other directories and obtain a directory listing of all the files in it.

12. Move back to the root directory (see step 10 above).

13. To find the version of DOS that you’re using, type [ver]. What version of DOS is installed?
______________________.

14. Using the help command. Type [help]. Navigate and become familiar with the various
options available within help.

15. What is the command for displaying a directory listing? _______________.

16. List the first two examples given in the help section for the command format. a)
_______________________, b) __________________

17. How are the following character combinations interpreted by the prompt command?

$P = ________________________________________________________

$G = ________________________________________________________

$D = ________________________________________________________

$T =_________________________________________________________

$V = ________________________________________________________

$N = ________________________________________________________

Exit help. Using the mouse, pull down the File menu, and select Exit; Or, using the
keyboard, press the following three keys [Alt-F-X

18. Change the prompt to show the date instead of the local directory. What is the new
prompt? _______________________.

6
19. Change the prompt to show the current time. What is the new prompt?
________________________.

20. Change the prompt back to the original.

21. Display the default Path. [path]. What is the default path? _________. This is the
location/s that DOS will look for files that are not in the current directory.

22. Change the default path to instruct DOS to look in the root directory, the DOS directory,
and the Checkit directory. [path c:\;c:\dos;c:\checkit].

23. What is the new path? ______________________________________.

2. CREATE A DOS RESCUE DISKETTE


1. Boot-up the system with the DOS Operating System, if not already there.
2. Format a floppy diskette and make it bootable. [format a: /s]
3. Copy additional files and utilities as shown below. Note that the file qbasic.exe is
needed in order to use the editor, edit.com. To copy fdisk.exe, which is located in the
DOS directory of drive c:, to the floppy diskette, type the following: [copy
c:\dos\fdisk.exe a:\]. Repeat the command for the remainder of the files. Remember
that not all the files listed below are located in the DOS directory so, if you get an error
message such as “file not found”, move around the different directories and use the DIR
command to locate the file/s.

FDISK.EXE DOSKEY.com
FORMAT.COM MEM.EXE
MOUSE.COM
QBASIC.EXE
EDIT.COM
MSCDEX.EXE
ATAPICD.SYS
HIMEM.SYS
EMM386.EXE
SCANDISK.EXE
DEFRAG.EXE

4. Using the editor, create the AUTOEXEC.BAT file shown below. Do not copy this file
from the c: drive, it will not work without extensive changes. Change drives to the A:
drive by typing a: <return> at the DOS prompt. To start the editor, type the following at
the DOS prompt: [edit a:\autoexec.bat] then type the commands exactly as shown
below. You can use upper or lower case, or a combination of both. The files are not case
sensitive.

7
The AUTOEXEC.BAT file should look as follows:

5. Save the file on the A: drive.

6. Similarly, using the editor, create the CONFIG.SYS file shown below, and save it in the
A: drive.

The CONFIG.SYS file should look as follows:

7. Using the “EDIT” command, display the contents of the AUTOEXEC.BAT and
CONFIG.SYS files and obtain the instructor’s initials for each.

AUTOEXEC.BAT __________________
CONFIG.SYS ____________________

8. Use the DIR command to list the contents of the diskette and obtain the
instructor’s initials.
DISKETTE CONTENTS _______________

8
3. TESTING THE RESCUE DISKETTE

1. Insert the newly created rescue diskette in drive A: (if it’s not already there) and
restart the system.

Observe the boot process, use the “pause” key to stop the boot process if needed and
verify that the CD-ROM drivers are being loaded; the “space bar” can be used to
continue the
boot process.
Look for the following key messages displayed on the monitor.

First the following:

Device Driver Name = CD003


CD-ROM device driver installed

Then the following:


Drive D: = Driver CD003 unit 0

And finally, the DOS prompt should appear:


A:\>

2. Have the instructor verify the final screen display and initial here _________.

3. Use the command [mem /c /p] to displays the amount of used and free memory in your
system.

4. How do the parameters /c and /p modify the mem command?


Hint: Change drive to c:\dos, then type help mem

/c ________________________________________________________

/p ________________________________________________________

5. You will learn later in this course about how memory (DRAM) is logically structured and
why. For now we only need to know that Conventional Memory is memory below
640KB, Upper Memory is memory between 640KB and 1MB, and Extended Memory
is the remainder of memory above 1MB. Armed with this information, we can now
obtain some useful information from the DOS’s memory display. Retype the [mem /c
/p] command if necessary, and record the following information:
What two programs or modules are using Upper Memory?
___________________________, and ______________________

9
From the Memory Summary section of the display, record the following:
Total Conventional Memory = ___________________

Used Conventional Memory = ___________________


Free Conventional Memory = ___________________
What is the Total amount of memory? ___________________
What is the largest executable program size? ___________________

6. Press the Up Arrow (↑) on key board and observe what is displayed on the command
line on the screen. Repeat pressing the up arrow a few times and summarize below
what is being displayed on the screen.

4. USING SCANDISK AND DEFRAG FROM THE RESCUE


DISKETTE
1. To familiarize ourselves with the operation of scandisk, we will use it to check drive A:
for errors and repair them if necessary.

2. Boot-up with your bootable diskette.

3. AT the A:> prompt, type scandisk.

4. When prompted, select Yes to perform a surface scan on drive A:. Observe the process,
it should take about 2-3 minutes to complete. Did scandisk find any problems with the
following: (hint: click on “View log”)

Directory structure? _________,MS-DOS file allocation table? ____

MS-DOS file system? _______, Surface scan? ___________

5 Next we will use defrag to optimize drive A: Click on Exit, and at the A:\> prompt, type
defrag. Select Drive A:, and click OK.

6 What percentage of drive A: is not fragmented? ________________.

7 What is the recommended optimization method? _________________.

8 Perform the recommended operation if any. When done, select OK and Exit Defrag.

10
QUESTIONS
1. What is the DOS command for deleting one or more files? __________.

2. What is the DOS command that configures a hard disk for use with MS-DOS?
_______________.

3. What is the DOS command that displays or changes file attributes?


_______________.

4. What two drivers are needed to enable the CD-ROM drive for use in DOS, and in which
system files should they be loaded from?
a) ____________________________________________________________
b)_____________________________________________________________

5. Why was the program QBASIC.EXE copied to the rescue diskette?


____________________________________________________________
____________________________________________________________

6. What is the purpose of the Path command?


________________________________________________________________

7. What command would you use to set the prompt to the following?

Good Morning, Sir. How May I Help You>

______________________________________________________________

8 What is the version of MS-DOS that you used in this Lab? __________.

9 What is the purpose of the REM command? ________________________

11

You might also like