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 onscreen 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.

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 its 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 Command APPEND ATTRIB BREAK CD CHCP CHDIR CHKDSK CHOICE CLS

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

COMMAND COMP COPY CTTY DATE DBLSPACE DEBUG DEFRAG DEL DELOLDOS DELTREE DIR DISKCOMP DISKCOPY DOSKEY DOSSHELL DRVSPACE ECHO EDIT EMM386 ERASE EXIT EXPAND FASTHELP FASTOPEN FC FDISK FIND FOR FORMAT GRAPHICS HELP INTERLNK INTERSVR KEYB

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

LABEL LH LOADFIX LOADHIGH MD MEM MEMMAKER MKDIR MODE MORE MOVE MSAV MSBACKUP MSD NLSFUNC PATH PAUSE POWER PRINT PROMPT QBASIC RD REN RENAME REPLACE RESTORE RMDIR SCANDISK SET SETVER SHARE SORT SUBST SYS TIME TREE

Creates, changes, or deletes the volume label of a disk. Loads a program into the upper memory area. Loads a program above the first 64K of memory, and runs the program. Loads a program into the upper memory area. Creates a directory. Displays the amount of used and free memory in your system. Starts the Memmaker program, which optimizes your computer's memory. Creates a directory. Configures a system device. Displays output one screen at a time. Moves one or more files. Also renames files and directories. Scans your computer for known viruses. Backs up or restores one or more files from one disk to another. Provides detailed technical information about your computer. Loads country-specific information. Displays or sets a search path for executable files. Suspends processing of a batch file and displays a message. Turns power management on and off. Prints a text file while you are using other MS-DOS commands. Changes the MS-DOS command prompt. Starts the MS-DOS QBasic programming environment. Removes a directory. Renames a file or files. Renames a file or files. Replaces files. Restores files that were backed up by using the BACKUP command. Removes a directory. Checks a drive for errors and repairs any problems it finds. Displays, sets, or removes MS-DOS environment variables. Sets the version number that MS-DOS reports to a program. Installs file-sharing and locking capabilities on your hard disk. Sorts input. Associates a path with a drive letter. Copies MS-DOS system files and command interpreter to a disk you specify. Displays or sets the system time. Graphically displays the directory structure of a drive or path.

TYPE UNDELETE UNFORMAT VER VERIFY VOL VSAFE XCOPY

Displays the contents of a text file. Restores files previously deleted with the DEL command. Restores a disk erased by the FORMAT command. Displays the MS-DOS version. Directs MS-DOS to verify that your files are written correctly to a disk. Displays a disk volume label and serial number. Continuously monitors your computer for viruses. 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 instructors instructions to load a clean copy of the MS-DOS Operating System. 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 *.].

2.

3.

Record all the directories shown: 1) _________________, 2) _________________, 3) _______________ 4) _________________, 5) _________________, 6) _______________ Change directory location, move into the DOS directory. [cd \dos] The prompt should now show the name of the directory you reside in. What is the prompt shown ____________________.

4. 5.

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

files have been displayed, the DOS prompt will then appear. Type the following command [dir /w]. The option /w stands for wide. Finally, the two options can be combined. [dir /w /p]

8. 9.

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 youre 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? _______________________.

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 1. 2. 3.

A DOS RESCUE DISKETTE

Boot-up the system with the DOS Operating System, if not already there. Format a floppy diskette and make it bootable. [format a: /s] 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 FORMAT.COM MOUSE.COM QBASIC.EXE EDIT.COM MSCDEX.EXE ATAPICD.SYS HIMEM.SYS EMM386.EXE SCANDISK.EXE DEFRAG.EXE DOSKEY.com MEM.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.

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 instructors initials for each. AUTOEXEC.BAT __________________ CONFIG.SYS ____________________

8.

Use the DIR command to list the contents of the diskette and obtain the instructors initials. DISKETTE CONTENTS _______________

3. TESTING 1.

THE RESCUE DISKETTE

Insert the newly created rescue diskette in drive A: (if its 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. 3. Have the instructor verify the final screen display and initial here _________. Use the command [mem /c /p] to displays the amount of used and free memory in your system. How do the parameters /c and /p modify the mem command? Hint: Change drive to c:\dos, then type help mem /c ________________________________________________________

4.

/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 DOSs 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 ______________________

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


To familiarize ourselves with the operation of scandisk, we will use it to check drive A: for errors and repair them if necessary. Boot-up with your bootable diskette. AT the A:> prompt, type scandisk. 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? ___________

1.

2.

3. 4.

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. What percentage of drive A: is not fragmented? ________________.

7 8

What is the recommended optimization method? _________________. Perform the recommended operation if any. When done, select OK and Exit Defrag.

10

QUESTIONS
1. 2. What is the DOS command for deleting one or more files? __________. What is the DOS command that configures a hard disk for use with MS-DOS? _______________. What is the DOS command that displays or changes file attributes? _______________. 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)_____________________________________________________________ Why was the program QBASIC.EXE copied to the rescue diskette? ____________________________________________________________ ____________________________________________________________ What is the purpose of the Path command? ________________________________________________________________ What command would you use to set the prompt to the following? Good Morning, Sir. How May I Help You>

3.

4.

5.

6.

7.

______________________________________________________________

What is the version of MS-DOS that you used in this Lab? __________. What is the purpose of the REM command? ________________________

11

You might also like