Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
90 views

Module2 - DOS

The document provides information about the Disk Operating System (DOS). It discusses that DOS was the first operating system used for IBM-compatible personal computers and was available in two versions - PC-DOS by IBM and MS-DOS by Microsoft. It operated using basic text-based commands instead of a graphical user interface. Some key commands included DIR, COPY, DEL, CD. The document also describes internal vs external commands, command line syntax, and frequently used DOS commands like FORMAT, CHKDSK, TYPE. It provides examples of using DOS commands and creating batch files to automate tasks.

Uploaded by

VERGEL VIRAY
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views

Module2 - DOS

The document provides information about the Disk Operating System (DOS). It discusses that DOS was the first operating system used for IBM-compatible personal computers and was available in two versions - PC-DOS by IBM and MS-DOS by Microsoft. It operated using basic text-based commands instead of a graphical user interface. Some key commands included DIR, COPY, DEL, CD. The document also describes internal vs external commands, command line syntax, and frequently used DOS commands like FORMAT, CHKDSK, TYPE. It provides examples of using DOS commands and creating batch files to automate tasks.

Uploaded by

VERGEL VIRAY
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Disk Operating System

What is DOS?
 Stands for "Disk Operating System."
 The first operating system used by IBM-compatible
computers.
 It was originally available in two versions that were
essentially the same, but marketed under two different
names.
PC-DOS was the version developed by IBM and sold to
the first IBM-compatible manufacturers.
MS-DOS was the version that Microsoft bought the
rights to, and was bundled with the first versions of
Windows.
DOS
DOS uses a command line, or text-based interface, that
allows the user to type commands.

While the commands are simple to type, the user must


know the basic commands in order to use DOS effectively.

This made the operating system difficult for novices to use,


which is why Microsoft later bundled the graphic-based
Windows operating system with DOS.
The Command Prompt

The text that appears on the screen before a blinking “_”


(underscore) character – cursor.
The default prompt is the Drive letter and Path of your current
location on the computer.
It is your drive letter followed by a “>” (the greater-than sign) that
separates the prompt from the text you enter.
The prompt C:\> sits there and waits, telling you that the
COMMAND processor is expecting you to enter a command.
Internal vs External
Commands
Internal Commands

• Built into the OS under COMMAND.COM


• Already in memory if the OS is loaded
• Available anytime the computer is displaying
a command prompt
• Generally, the more frequently used
commands
• Examples:
DIR, COPY, CLS, CD, MD, DEL, TIME, DATE
External Commands

• Not part of COMMAND.COM.


• Located in another directory as external files.
• Must be loaded into memory as needed by
the OS.
• Examples:
FORMAT, DEFRAG, DISKCOPY, DEBUG, EDIT
• A specific set of rules that you must
follow when writing commands.
• The order in which you arrange the
elements of the command.
• The rules of grammar for the command
line.
Example: DIR B:/P
- what action to perform.
A unique word or set of characters that identifies the action to
be performed.
The DOS command itself

- what is acted upon.


Additional directions for the command.
It may specify a directory or file on which to perform the action.
It may specify a hardware device.
It may specify a system setting.

- How to perform the action.


A special type of parameter that enables or disables optional
functions of the command.
The /P switch with the DIR command displays the directory one
screen at a time.
The /W switch with the DIR command displays the directory in
wide format.
Backslash vs Forward Slash

\ Backslashes are used as separators when


specifying directory or file information.

/ Forward slashes are used to notify DOS that


the next character is a command line switch.
Getting Help

Type HELP followed by the command you want


to know about.

Type the command and then follow it with the


switch /?.
List of Frequently used DOS Commands
CHKDSK – Checks a disk and displays a status report about
the drive.
CLS – Clears the screen.
COMP – Compares two groups of files to find information
that does not match.
COPY – Copies and appends files.
DATE – Displays and sets the system date.
TIME - Displays and sets the system time.
DEFRAG – Optimizes disk performance by reorganizing the
files on the disk.
LABEL/VOL – Creates or changes or display a volume label
for a disk.
MEM – Displays amount of installed and available memory,
including extended, expanded, and upper memory.
List of Frequently used DOS Commands
DEL – Deletes files from disk.
DELTREE – Deletes a directory including all files and
subdirectories that are in it.
DIR – Displays directory of files and directories stored
on disk.
DISKCOMP – Compares the contents of two disks.
ECHO – Displays messages or turns on or off the
display of commands in a batch file.
EDIT – Starts the MS-DOS editor, a text editor used to
create and edit ASCII text files.
EXIT – Exits a secondary command processor.
COPY CON - Creates a file.
List of Frequently used DOS Commands
EXPAND – Expands a compressed file.
HELP – Displays a list of DOS commands with a brief
explanation of each.
FIND – Finds and reports the location of a specific
string of text characters in one or more files.
FOR – Performs repeated execution of commands (for
both batch processing and interactive processing).
FORMAT – Formats a disk to accept DOS files.
IF – Allows for conditional operations in batch
processing.
SET - Taking user input at DOS prompt.
TYPE - Display the contents of a file.
List of Frequently used DOS Commands
MKDIR/MD – Creates a new subdirectory.
CHDIR/CD - Changes directory
RMDIR/RD – Removes a subdirectory
MOVE – Moves one or more files to the location you
specify.
REN – Changes the filename under which a file is stored
COPY – Copies directories, subdirectories, and files
XCOPY - Copies directories
PAUSE – Suspends execution of a batch file until a key is
pressed
TITLE - Used in a batch file to give the script window a
meaningful name
Batch file
• A script file in DOS, OS/2 and Microsoft Windows.
• Consists of a series of commands to be executed by the command-line interpreter,
stored in a plain text file.
• .bat or .cmd
EXERCISES:
1. Copy file1.txt and create file2.txt, file3.dat, file4.xyz, file5.txt. Pay
attention to the names and extensions of the files.
2. List out the directory to see ALL the newly created files.
3. Now, see a list of the files that has TXT extension.
4. Make a copy of file4.xyz and call it first.dat
5. Create a subdirectory under the directory you're currently in. Call this
new directory TESTDIR
6. Copy all the files with an extension DAT to the newly created
subdirectory.
7. Change directory to the newly created directory and list all the files in
there.
8. Delete file3.dat.
9. Go back up to the parent directory of the current directory you are in.
Exercises:
10. List all the file with an extension DAT in the current directory
and the one you just created. Use only one command to do so.
11. Change the name of file1.txt to file6.txt.
12. Delete the directory you created (TESTDIR). Are you able to do
this? Why or Why not? Answers not required.
13. Delete the remaining file/s in TESTDIR and now delete the
directory.
14. List all the files that start with FI with extension TXT.
15. List all the files that start with the word FILE followed by a
single character with an extension TXT.
16. List all the files in the directory, what are the remaining files?
SET Command
accepts input from a user as the value for a variable.

Syntax:
SET /P <var> = [<prompt message>]
Example:
------------------------------------------------------------------------------------------------
@ECHO OFF
SET /P uname=Please enter your name:
IF "%uname%"=="" GOTO Error
ECHO Hello %uname%, Welcome to DOS Scripting!
GOTO End
:Error
ECHO You did not enter your name! Bye bye!
:End
PAUSE

You might also like