Operating systems part 2… Introduction to MS-DOS

advertisement
Operating systems continued…
Introduction to MS-DOS
MS-DOS basics:












What is MS-DOS?
MS-DOS stands for Microsoft Disk Operating System. MS-DOS controls
the computer’s hardware and provides an environment for programs to
run. This system program must always be present when working with
your computer.
Why You Need MS-DOS
There are a variety of reasons why you need MS-DOS. A few of them
are listed below to satisfy your curiosity.
0. Windows is built upon MS-DOS and it is easy and fast to learn
programming under MS-DOS as compared to Windows. So, it is
good
for beginners
1. MS-DOS controls the flow of information between you and the
computer (translator).
2. MS-DOS allows you to store information on your computer.
3. MS-DOS allows you to retrieve information stored on your computer.
4. MS-DOS interprets and translates the software you have on your
computer.
5. MS-DOS gives you access to all its function (i.e. saving, copying, and
printing files).



This small introduction gives us an opportunity to try basic MSDOS commands.
By following the procedures in this unit and the self study file, you
will learn to:
 View the contents of a directory
 Change from one directory to another
 Create and delete directories
 Change from one drive to another
 Copy files
 Rename files
 Delete files
 Format a floppy disk
NOTE: Students have to use the DOS self-study file provided
along with this unit for detailed understanding of Commands.










The Command Prompt
When you first turn on your computer, you will see some cryptic
information flash by. MS-DOS displays this information to let you know
how it is configuring your computer. You can ignore it for now. When the
information stops scrolling past, you'll see the following:
C:\>
This is called the command prompt or DOS prompt. The flashing
underscore next to the command prompt is called the cursor. The
cursor shows where the command you type will appear.
If your command prompt looks like the sample command prompt above,
skip to the following section, "Typing a Command."
If your command prompt does not look like the example, type the
following at the command prompt, and then press ENTER:
cd \
Note that the slash leans backward, not forward. You will learn more
about the cd command later in the tutorial. If your command prompt still
doesn't look like the example, type the following at the command
prompt, and then press ENTER:
prompt $p$g
Your command prompt should now look like the example.



Typing a Command
This section explains how to type a command at the command prompt and
demonstrates the "Bad command or file name" message.
To type a command at the command prompt


If you make a typing mistake, press the BACKSPACE key to erase the mistake,
and then try again.








Press ENTER. You must press ENTER after every command you type.
The following message appears:
Bad command or file name
The "Bad command or file name" message appears when you type something that
MS-DOS does not recognize. Because nul is not a valid MS-DOS command, MSDOS displays the "Bad command or file name" message.


Type the following at the command prompt (you can type the command in either
uppercase or lowercase letters): nul
Now, type the following command at the command prompt:
ver
The following message appears on your screen:
MS-DOS version 6.22
The ver command displays the version number of MS-DOS.
Continue to the next section, where you will use the dir command to view the
contents of a directory.



Viewing the Contents of a Directory
In this section, you will view the contents of a directory by using the dir command. The dir
command stands for "directory."
To view the contents of a directory



Type the following at the command prompt:
dir
A list similar to the following appears:
Volume in drive C is MS-DOS_6.22
Volume Serial Number is lE49-15E2
Directory of C:\
WINDOWS
TEMP
CONFIG SYS
COMMAND COM
WINA20 386
DOS
AUTOEXEC BAT

<DIR>
09-08-92 10:27p
<DIR>
05-15-92 12:09p
278 09-23-92 10:50a
53014 09-18-92 6:00a
9349 11-11-91 5:00a
<DIR>
09-02-92 4:23p
290 09-23-92 10:54a
7 file(s) 62931 bytes
8732672 bytes free
This is called a directory list. A directory list is a list of all the files and subdirectories that a
directory contains. In this case, you see all the files and directories in the main or root
directory of your drive. All the files and directories on your drive are stored in the root
directory.


MS-DOS Help
MS-DOS Help program is a good companion when you are learning DOS commands. The
following table shows five different ways to activate the DOS help program.
Commands used*
Description
HELP
"MS-DOS Help: Command Reference"
It provides complete, interactive Help information for MSDOS commands. A full list of commands is shown for
selection.
HELP [command]
FASTHELP [command]
[command] /?
"MS-DOS Help: [command]"
Provides complete, interactive Help information for the
specified MS-DOS command.
You can see the specific help information including
syntax, notes and examples.
Example: HELP XCOPY
Provides summary Help information for MS-DOS
commands.
It includes the description of the specific command,
syntax of using it, and the explanation of the available
switches.
Example: FASTHELP XCOPY
Provides summary Help information for MS-DOS
commands. It includes the description of the specific
command,syntax of using it, and the explanation of the
available switches. Example: XCOPY /?
Brief Description of Internal MS-DOS commands
 (Source: MS-DOS 6.22 Fasthelp)
 BREAK Sets or clears extended CTRL+C checking.
 CALL Calls one batch program from another.
 CHCP Displays or sets the active code page number.
 CHDIR Displays the name of or changes the current directory.
CD Displays the name of or changes the current directory.
 CLS Clears the screen.
 COPY Copies one or more files to another location.
 CTTY Changes the terminal device used to control your system.
DATE Displays or sets the date.
 DEL Deletes one or more files.
 ERASE Deletes one or more files.
 DIR Displays a list of files and subdirectories in a directory.

ECHO Displays messages, or turns command echoing on or off.

EXIT Quits the COMMAND.COM program (command
interpreter).
Brief Description of Internal MS-DOS commands
continues….













FOR Runs a specified command for each file in a set of files.
GOTO Directs MS-DOS to a labelled line in a batch program.
IF Performs conditional processing in batch program.
LOADHIGH Loads a program into the upper memory area.
LH Loads a program into the upper memory area.
MKDIR Creates a directory.
MD Creates a directory.
PATH Displays or sets a search path for executable files.
PAUSE Suspends processing of a batch file and displays a
message.
PROMPT Changes the MS-DOS command prompt.
REM Records comments (remarks) in a batch file or config.sys.
RENAME Renames a file or files. REN Renames a file or files.
RMDIR Removes a directory. RD Removes a directory.
Brief Description of Internal MS-DOS commands
continues….








SET Displays, sets, or removes MS-DOS environment variables.
SHIFT Changes the position of replaceable parameters in a batch
file.
TIME Displays or sets the system time.
TYPE Displays the contents of a text file.
VER Displays the MS-DOS version.
VERIFY Directs MS-DOS to verify that your files are written correctly
to a disk.
VOL Displays a disk volume label and serial number.
EXTERNAL commands
External commands are MS-DOS utilities / programs. These are
the .EXE or .COM programs located on your hard drive. They
are normally placed under C:\DOS, the default directory. MSDOS will load external commands if and only if you instruct to
execute them at the DOS prompt and /or in a batch program.
End of a brief Introduction
Download