MS-DOS
MS-DOS (Microsoft Disk Operating System), introduced in 1981, was the
standard single-user operating system of IBM and IBM-Compatible
computers. It is a system software which is famous in the world. It includes
commands which one used to perform the following operation:
a) Starting the computer
b) Running application programs & Utilities.
c) Managing files and directories
d) Maintaining disk
e) Optimize the use of hardware.
f) Speed up the programs etc.
Mainly three system files are:
i) IO. Sys ii) MSDOS.SYS iii) Command.com
To Load MSDOS program
Start---------->Programs---------------->MSDOS prompt
or
Start------->Run---------> Command ----->OK
or
Start------->Shut down---------> Restart in MS-DOS mode----->OK
Cursor A blinking character on the command line which indicates
where we typed character appears on the screen. After
getting character at the cursor position it moves one space
right.
Command Instruction given to the computer by using some specified
name or syntax or formula is called command. MS-DOS
command consists up to fields.
1. Command name,
2. Parameters
3. Switch
Prompt Prompt indicates that the computer is ready to accept the
instruction or command from the user.
Command The line which consists the prompt sign is command line.
line E.g : C:\>
Command Command name is the name of a command which
name indicates what to do.
E.g. C:\>Ver (enter)
MS-DOS version 6.22
In the example VER is a command name on command line
after C prompt
Command This follows immediately after the command name and
Prompt indicates on which object.
E.g. C:\>Del Office.stf (enter)
In this example, office.stf is a parameters.
MS-DOS has term with the following matters:
1. Program It often is called application programs which are series of
instructions written in computer languages.
2. File It is a collection of related with information or data which is
used for easy identification and retrieval of data or
information for further use like the contents of a file folder
in desk drawer might containing business letters, officer
memos, or monthly sales data etc.
3o. File Each file has a name on a disk that is called filename. The
Name filename has two parts, first name & optional extension.
First name can be 1 to 8 characters and extension can be
up to 3 characters in length, both upper or lowercase. The
extension is given after dot(.) and it is not compulsory but it
is good idea to recognize the contents as of a file. For
example office.stf, on that example office is first name and
stf is extension name.
The following characters can be used to name a file:
a) Letters as a to z or A to Z.
b) Numbers 0 to 9
c) special character as $, #, &, {,(,!, but *, - , +, /,
% etc. can not be used.
Do not use the following extension as BIN, SYS, COM,
Exe etc.
Keys are used in MS-DOS
Enter : To input the given command.
Spacebar : To move the cursor to the right.
Backspace : To delete left one character.
Delete : To delete right one character at the cursor.
Basic DOS command:
It can be broadly classify into two parts:
1. Internal DOS commands.
2. External DOS commands
1. Internal DOS commands:
Certain DOS commands which are most frequently used one conduct into
RAM or primary memory or main memory during booting. Actually these
commands are a part of command.com files. These command can be
accesses very fast. Such, commands are called internal commands as
DIR, DATE, TIME, CLS, VER,PROMPT,VOL, COPY CON, TYPE, COPY,
REN, DEL etc.
It is also called resident commands because they always reside in the
computers memory tills the power is on.
To create a file:
(COPY CON command)
This is an internal command. It is used to make a file in the MS-DOS.
Syntax: C:\> COPY CON <file name> . <extension>
Eg. C:\>COPY CON Anita.txt
Type the any text. When finished the typing then press F6 key or CTRL+Z
() key.
to save file. Then press enter (
To list files and directories
(DIR command)
This is an internal command of DOS. DIR command displays a list of files
and sub directory names. DIR display the additional file storage space.
Syntax: C:\>DIR [DRIVE:] specifies the drive, directory and files to list.
/P Pauses after each screen-full of information filename,
directories in the current dir, file size, date and time
created will be displayed
/W Uses wide list format.
C:\>DIR
C:\>DIR/P
C:\>DIR/P
C:\>DIR/W
C:\>DIR/W
C:\>DIr/P/W
C:\>DIr/P/W
C:\>DIR Anita. Txt
To list file Contents
(TYPE command)
This command is used to display the content of text file information. It is
also an internal DOS command.
Syntax: C:\>Type <File name>. <File extension>
Eg. C:\>Type Anita.Txt
Note: If we have a large volume of text, in that cases we can use more
command.
:more
Eg. C:\>Type Anita.txt :more
To Rename a file
(REN command)
This command is used to rename a file. it is also an internal DOS
command.
Syntax:C:\>REN <Old file name> <New file name>
Binita.txt
Eg, C:\>REN Anita.txt Binita.txt
To delete a file
(DEL or ERASE command)
This command is used to delete a file or a group of files. We can delete file
of another drive of files of another location on the same disk. It is also an
internal DOS command.
Syntax C:\>DEL <file name>.<extension>
Eg, C:\>DEL Anita.txt
or
C:\>ERASE Anita.txt
To Copy a file
(COPY COMMAND)
This is an internal command of DOS. It is used to make a duplicate file.
This command is used to copy file from one disk to another disk.
Syntax: C:\>COPY <source file> <New file>
Eg, C:\>Copy Anita.txt Binita.txt
To Merge a file:
(COPY command)
Syntax: C:\>Copy <Source file1>+ <Source file2> <New filename>
Kiran.txt
Eg, C:\>COPY Ajay.txt+Mahesh.txt Kiran.txt
Prompt command
This is an internal command. This command change the MS-DOS
command prompt.
Syntax: C:\>Prompt [text]
Prompt can be made up normal character and the special codes. some of
them are listed below..
$Q= Equal sign. $$=$ (Dollar) $T= Current time
$D= Current date $P=Current drive and path
$G= Greater than sign
$L= Lesser than sign.
MAXPRO
Eg. C:\>PROMPT MAXPRO
$P$G
MAXPRO PROMPT $P$G C:\>
C:\>PROMPT $D
$T
C:\>PROMPT $T
TIME COMMAND
This is an internal command. This command display the current time or
allows to change. The current time is according to internal clock of the
computer.
Syntax: C:\>TIME [HH:MM:SS]
Where,
HH Specifies the hour ( 0 to 23)
MM Specifies the minute ( 0 through 59)
SS Specifies the second (0 through 59)
Eg. C:\>TIME
Current time is 10:07:56:07p
Enter new time:
In above prompt, type time as HH:MM:SS. You can type time on the prompt
as:
C:\>TIME 10:30
Date Command
To displays current date and allows to set new date.
Syntax: C:\>DATE [date]
Eg, C:\>DATE
Type current date according to MM-DD-YY format.
VER COMMAND
This is an internal command displays the MS-DOS version currently in use.
C:\>VER
VOL command
This is an internal command. This command displays the volume label of
the disk drive. This also displays the serial number, if exists:
Syntax: C:\>VOL [drive:]
DIRECTORY
It is a table of contents for a disk and it is used to arrange many files. A disk
can contain hundred of files which are categorized into different groups for
easy identification. Each group is given name such name is termed
directory. On simplest form a directory in collection of related files. A
directory can have also subdirectories too.
TO CREATE A DIRECTORY
(MD command)
Syntax: C:\>MD <directory name>
Ram
Eg. C:\>MD Ram
TO CHANGE DIRECTORY
(CD command)
This is an internal DOS command. This command displays the name of the
current directory or you can change the directory.
Syntax: C:\>CD <entering directory name>
Ram
Eg. C:\>CD Ram
TO CHANGE OR EXIT THE PARENT DIRECTORY.
(CD .. command)
Eg. C:\Ram>CD..
C:\>
BACK RETURNING FROM THE ROOT LEVEL C:\>
(CD\ command)
Eg. C:\Ram\Shyam\Hari>CD\
Eg. C:\>
TO REMOVING A DIRECTORY
(RD command)
This command is used to remove a directory. Only empty directories can be
removed.
Notes: Before removing the directory the following cases must be satisfied.
a) The removing directory should be totally empty, it means there
should be no files.
b) We should come out from the removing directory with the help
of CD .. command.
Syntax: C:\>RD <empty directories name>
Ram
Eg, C:\>RD Ram
TO COPY A FILE ONE DRIVE TO ANOTHER DRIVE
E The files Ram.txt will be copied into
g. C:\>Copy Ram.txt A: Floppy drive (A:\>)
Eg. A:\>Copy Ram.txt C: The file Ram.txt will be copied into
Hard Drive (C:\>)
C:\AJAY\RAJA.TXT
C:\>COPY RAM.TXT C:\AJAY\RAJA.TXT
C:\AMAR\KIRAN.TXT
C:\>COPY C:\AJAY\RAJA.TXT C:\AMAR\KIRAN.TXT
C:\AMAR\ASHOK\RAJAN.TXT
C:\>COPY RAJA.TXT C:\AMAR\ASHOK\RAJAN.TXT
C:\>COPY C:\AMAR\ASHOK\RAJAN.TXT C:\>ANJAN\SAGAR\
RAJESH.RAJ
RAJESH.RAJ
Using wildcards character.
* It indicates any characters.
? It indicate anyone character
.* It indicates any extensions.
*.* It indicates any file & any extension.
Listing a group of files by using wild cards
*.TXT
C:\>DIR *.TXT
R*.TXT
C:\>DIR R*.TXT
R*.*
C:\>DIR R*.*
????.TXT
C:\>DIR ????.TXT
C:\>DIR ????.*
Deleting a group of files by using wild cards.
*.TXT
C:\>DEL *.TXT
R*.TXT
C:\> DEL R*.TXT
R*.*
C:\> DEL R*.*
????.TXT
C:\> DEL ????.TXT
C:\> DEL ????.*
To renaming a group of files by using wild cards
*.SHR
C:\>REN *.TXT *.SHR
T*.SHR
C:\>REN R*.TXT T*.SHR
S*.*
C:\>REN R*.* S*.*
*.SHR
C:\>REN ????.TXT *.SHR
To copying a group of files by using wild cards
*.SHR
C:\>COPY *.TXT *.SHR
T*.SHR
C:\>COPY R*.TXT T*.SHR
S*.*
C:\>COPY R*.* S*.*
*.SHR
C:\>COPY ????.TXT *.SHR
C:\AJAY
C:\>COPY *.TXT C:\AJAY
C:\ANITA\*.SHR
C:\>COPY C:\AJAY\*.TXT C:\ANITA\*.SHR
2. External DOS commands: These command are excluded and it is used if
their special file is been as format.com for format command as same as
other commands are ATTRIB, DELTREE, LABEL, EDIT, MOVE,
SCANDISK, DEFRAG, CHKDSK, EDIT.COM etc. These commands access
time slower that internal commands.
TO LABEL A DISK
(LABEL command)
This is an external command. This command displays the disk drive
volume label. Label allows to change the volume label of the disk drive.
Syntax: C:\>LABEL [DRIVE:][LABEL]
Eg. C:\>LABEL C:
Note: Type label up to 11 character a long.
TO CHECK A DISK
(CHKDSK command)
This is an external command. This checks disk and displays a status
report. The distinct operation performed by this command are:
Displays the label, creation date and serial number of the disk.
Checks the integrity of the DOS files.
Displays the storage capacity of the specified disk.
Displays the number of bytes in bad sector if any.
Syntax: C:\>CHKDSK [DRIVE:][PATH]filename
Eg. C:\>CHKDSK C:
Note: Type CHKDSK without parameters to check the current disk.
An Editing a DOS text file
(EDIT command)
Syntax: C:\>EDIT <FILE NAME> . <EXTENSION>
EG, C:\>EDIT RAM.TXT
Now edit the contents when finished press Alt, F,S to save and Alt, F, X to
exit in normal screen.
To Rename a directory name
(MOVE command)
This command is used to change the directory name. It is also external
command.
Syntax: C:\>MOVE <Source Directory name> <New directory name>
Shyam
Eg, C:\>Move Ram Shyam
SYS command
This is an external command. The command is used to transfer DOS
system files from one disk to another. This command allows the user to
make a bootable disk.
Syntax: C:\> SYS [DRIVE:][PATH] drive 2
Eg. C:\>SYS A: (Transfer system files from drive C: into A drive)
ATTRIB COMMAND
It is an external Dos command, which is used to attributes the files.
Syntax: C:\>ATTRIB <filename>.<file extension> +h | -h |+R | -R
+ Sets an attributes
- Clear an attributes
H Hides the specified files
R Hides the file read only.
Eg, C:\>ATTRIB RAM.TXT +H
C:\>ATTRIB RAM.TXT -H
C:\>ATTRIB RAM.TXT +R
C:\>ATTRIB RAM.TXT -R
TO DELETE A DIRECTORY
(DELTREE command)
Syntax: C:\>DELTREE <directory name>
C:\>Deltree Ram
- Select "Y" for yes and "N" for No.