Disk Operating System (DOS) is the first program that must be loaded before using a personal computer. It allows users to manage files and directories. Files have names with 8 character limits and optional extensions up to 3 characters. Directories contain file names, sizes, and timestamps. DOS commands include internal commands like DATE, TIME, DIR, COPY, TYPE, EDIT, DEL, RENAME, MD, CD, RD and external commands like FORMAT to format disks and BATCH files to run groups of commands. Wildcard characters like * and ? can be used in commands to represent multiple files.
1. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
M.S. DOS
DOS: Disk operating System
Disk Operating System is the first program that must be loaded in the memory of your PC
before you can use it for any application. Different version of DOS, such as 2.0, 3.0, 4.0, 5.0,
6.0, 6.2, 7.0, 8.0 are available. The higher versions have more features and commands.
However, the basic commands and features are available in all versions.
File, File name & Directory
A File is collection of related information. Like the contents of the file folder in a
desk, your computer might contain files related to different topic owned by different people.
Just as each folder in a file cabinet has a label, each file on a disk has to have a name.
This name has two parts a filename and an extension. While naming a file following points
should be kept in mind:
File name cannot exceed 8 characters.
Dot or period is optional, can be used for better management of files.
Extension, which is optional, cannot be exceeding 3 characters.
Some name and filename extensions have special meaning to DOS and to your
computer usage of such names should be avoided.
A directory on a disk is like a table of contents in a book. It contains the name of the file,
size of file. The data and time are also stamped, when files are created or modified.
2. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
Internal & external DOS Commands
There are two types of DOS commands – internal & external. The internal commands
are those commands that are automatically loaded in the memory of your PC when DOS
is loaded. These commands can be used without the need of any DOS file or diskette. The
internal commands are simple and are used for common tasks such as copying, renaming
or erasing files; displaying a list of files in a diskette; creating and changing directories;
changing the current date in your PC etc. the external commands are used for relatively
complex jobs, such as copying an entire diskette, formatting a diskette; comparing or
joining files, sorting text etc.
Internal commands External Commands
DATE FORMAT
TIME
VER
DIR
DIR/P
DIR/W
COPY CON
TYPE
EDIT
DEL
CLS
RENAME
MD BATCH FILE
CD WILD CARDS
RD
COPY
ATTRIB
3. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
Internal Commands:
1. To Come Out Window C:Windows> CD..
2. Date To See or Change the current Date of your System.
Syntax
C:>Date
The Current Date is Tue 02-03-2009 [American Format]
Enter the New Date (mm-dd-yy) …………..
3. Time To see or to Change the Current time of your system.
Syntax
C:>Time
The Current Time is 3:35:49.34a
Enter the New Time ………….
4. Ver To see the version of your system.
Syntax
C:/>Ver
Windows 98 [Version 4.10.2222]
5. Dir To see the list of files and folders existing in your disk.
Syntax
C:/>Dir
4. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
6. Dir/p To see the Directory Page Wise.
Syntax
C:/>Dir/p
7. Dir/w To see the Directory Width Wise.
Syntax
C:/>Dir/w
8. Copy con This command is used to create a Text file on your disk.
Syntax
C:/>Copy con <File name>
Example:
C:/>copy con ABC
Type your text
(Hi…! My name is Money Gupta.
My institute name is Galaxy)
Press <ctrl + z> to save the file.
9. Type This command is used to see the contents of any existing file.
Syntax
C:/>Type <file name>
Example:
C:/>type ABC
10. Edit This command is used to make changes in any text file.
Syntax
C:/>Edit <File name>
Example:
C:/>Edit ABC
11. Cls This command is used to clear the screen.
5. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
Syntax
C:/>Cls
12. Del This command is used to delete the files from your disk.
Syntax
C:/>Del <file name>
Example:
C:/>Del ABC
13. Rename Just as there are times when you need to assign a anew name to file in
your office, there are times when you want to rename a file on the
disk. The RENAME command or REN (short name) can change a
file’s name or extension or both. The rename command has two
parameters.
Syntax
C:/>Rename <Old name> <New file name>
Example:
C:/>Rename abc pqr
14. Copy This Command is used to create another copy of any existing file in
same directory.
Syntax
C:/>Copy <Original file name> <copied file name>
Example:
C:/>copy pqr mno
This Command is used to create another copy of any existing file in
another directory.
Syntax
C:/>Copy <Original file name> <directory name>
Example:
C:/>copy abc mohan
15. MD Make Directory.
6. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
MD command is used to create a new directory.
Syntax
C:/>md [Dir Name]
Example:
C:/>md mno
16. CD Change Directory & Sub- directory
CD Command is used to Change & open the Directory or Sub-
directory.
Syntax
C:/>CD [Dir Name]
Example:
C:/>cd mno
Your mno directory is open.
C:/mno>
To come out for your directory.
C:/mno>cd..
17. RD Remove Directory & Sub- directory
RD Command is used to remove the Directory or Sub-directory.
1. Directory should be Empty.
2. Path should be Valid
Syntax
C:/>rd [dir name]
Example:
C:/>rd mno
18. Attrib This command is used to hide the file & Protect the file.
1.) +H = Hide the file.
Syntax
7. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
C:/>attrib +h <File name>
Example:
C:/>attrib +h abc
2.) -H = Unhide the file.
Syntax
C:/>attrib -h <File name>
Example:
C:/>attrib -h abc
3.) +R = Read only file
Syntax
C:/>attrib +r <File name>
Example:
C:/>attrib +r abc
4.) -R = Remove read only
Syntax
C:/>attrib -r <File name>
Example:
C:/>attrib -r abc
External Commands
19. Batch File Group of Dos commands is called batch file. A Batch file should have
Extension .bat .
8. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
Syntax
C:/>Copy con <Batch file name.bat>
……
……
…… Dos Commands
……
……
……
For save the file ctrl+z
Example:
C:/>Copy con abc.bat
Date
Ver
Time
Dir
Dir/p
Dir/w
Cls
^Z (ctrl+z)
1 File(s) copied
To run the file only type file name then press enter.
20. Wildcard Wildcard Character are those character which are used for substituting
one character or a set of character. The wildcard characters are used to
restrict the scope of a DOS command to only those files which match
pattern specified. These are of two types ----‘*’ and ‘?’, where ‘*’
substitutes a set of character and ‘?’ substitutes a character at a single
particular position.
9. Galaxy Computer Education(ISO 9001:2015 CERTIFIED)
(1) .*
Syntax
C:/>dir <filename>.*
This command has displayed the directory with all the file names
having their primary name as <file name>, irrespective of the
extension.
Example:
C:/>dir abc.*
(2) *.*
Syntax
C:/>dir L*
The given command has displayed all files stating with ‘L’ regardless
of the extension in the directory, this command can also written as
DIR L*.* The command has picked up all files with extension .DOC
and displayed it. The above command can be written as ‘dir.doc’ to get
the same effect.
21. FORMAT This is an external command of DOS; to execute this command the file
FORMAT.COM is required.
Purpose: This command is used to create a new tracks and sectors on
your system disk. The number of the sectors and tracks depends on the
capacity of the disk.
Syntax:
C :>format <drive name>
Example:
If a user wants to format his drive a then the procedure is: