Professional Documents
Culture Documents
DOS COMMANDS
• Internal Commands
• External Commands
Internal Commands
Internal Commands are those commands that are automatically loaded in the memory
when the operating system DOS is loaded into the memory (RAM). These commands are
not seen when user views the directory by using DIR Command at the dos prompt. These
commands cannot be copied, deleted & renamed. Some commonly used Dos Internal
commands are:-
Syntax = C:\>CLS
The purpose of this command is to clear the displayed screen & redisplay the DOS
Prompt at the upper left corner of screen.
It displays the list of directories and files on the screen. Directories stores group of files.
Directories can be created by user. Directories can be of three types.
a) Current directory b) Sub directory c) Root directory
C:\ AIMIT\LETTER
Drive Root AIMIT LETTER
Directory Directory Sub Directory
Page 2 of 11 Chapter 2: Dos Commands
File: A file is the primary unit of storage on the computer. A file is a collection of text
data. Different types of documents like letter, invoices, memos etc are stored in a text file
whereas databases are stored in a database file.
Syntax = C:\>DIR/switches
C:\>DIR drive name
C:\>DIR/wild card
C:\> DIR/switches
Wild cards: It is a set of special characters that are used with some commonly used dos
commands. There are two types of wild cards.
Question mark (?): This wild card represents a single character that a group of files have
in common.
Ex. C:\> DIR ?AM.TXT will display all the text files having any first character and
remaining is given in command.
Page 3 of 11 Chapter 2: Dos Commands
C:\> DIR ???R.DBF will display all the database files having first three letter and fourth
letter is R.
Syntax = C:\>DATE
Current date is Tue 04-23-2002
Enter new date (mm-dd-yy):
It displays the current system’s date. User can also change the current date with new date.
Syntax = C:\>TIME
Current time is 12:23:11.31p
Enter new time:
It displays the current system’s time. User can also change the current time with new
time.
Syntax = C:\>VOL C:
The purpose of this command is to display the volume label or name of the disk. The
length of the name of disk does not exceed 11 characters.
Syntax = C:\>VER
Windows 98 [Version 4.10.2222]
[In syntax
• Extension (Ext) is optional.
• Filename can be maximum of :-
o 8 char in DOS
o 286 char in WINDOWS
It is used to create new file. The file created by this command can not be modified. If user
tries to modify the contents of the file using Copy con, it will display the message “File
already exists. Overwrite it (Y/N)?”
It is used to view the contents of the file. This only displays the information in the file. If
it is longer than the screen, it scrolls upward till the last line of the file is displayed. The
contents of the files move upward so rapidly that it is difficult to read it. However user
can pause the movement of scrolling by pressing Ctrl-S keys of Pause key button from
keyboard.
It is used to rename an old file name with new file name. Renames a file / directory or
files / directories.
C:\> CD\
It will directly move to the root directory from any logged subdirectory.
13) PATH :-
The purpose of this command is to provide access to files located in other directory path
or other disk. User can access only those files that have extension .EXE, .COM, BAT. By
setting the path to these executable files user can execute them from anywhere on the
DOS prompt. There are three options for setting of path to executable files.
Syntax = PATH
It will display the path set by user as PATH = C:\TC\BIN;
Syntax = PATH;
It copies all the files from floppy disk drive A in to hard disk in directory AIMIT.
Page 6 of 11 Chapter 2: Dos Commands
It is used to copy files from one directory to the same directory or another directory or
disk.
Syntax = C:\>EXIT
17) PROMPT :-
It is used to change the Windows command prompt. It is followed by space and a dollar
sign ($) followed by special character.
Text specifies a new command prompt. Prompt can be made up of normal characters and
the following special codes:
$Q ## = (equal sign)
$$ ## $ (dollar sign)
$T ## Current time
$D ## Current date
$P ## Current drive and path
$V ## Windows version number
$N ## Current drive
$G ## > (greater-than sign)
$L ## < (less-than sign)
$B ## | (pipe)
$H ## Backspace (erases previous character)
$E ## Escape code (ASCII code 27)
$_ ## Carriage return and linefeed
Note: Type PROMPT without parameters to reset the prompt to the default setting.
Page 7 of 11 Chapter 2: Dos Commands
External Commands
External Commands are conventional program files. These files can be deleted, copied,
modified and even renamed. These files can be deleted, copied, and renamed. These
commands can be displayed by typing DIR at the dos prompt. Ex: EDIT, CHKDSK,
DELTREE, FORMAT, SCANDISK, and DOSKEY etc.
It is used to create a new file of modify the contents of an existing file. Edit commands
has few pull down menus which can be activated by pressing Alt key.
2) ATTRIB :-
This command is used to change the attribute of a file i.e. user can use ATTRIB
command to make a file “read only” which prevents the file from the change of contents.
It returns the configuration status of the selected disk. It returns the information about
Volume serial number, Total disk space, space in hidden files, space in directories, total
memory and free memory space.
It is used to make duplicate copy of a disk like Xerox copy. It first formats the target disk
the copies files from source disk to target disk. It makes the perfect replica of the source
disk.
It is used to compare two disks to find out whether they are identical or not. They
compare tracks, sectors, etc. This command is generally used after DISKCOPY
Command.
: It is used to compare two disks to find out whether they are identical or not. If users try
to compare two dissimilar disks DISKCOMP will display an error message (like this
compare has error on side<<no.>>, track<<no.>>). If comparing successful the message
like Compare OK is displayed
6) DELTREE :-
Note: Use DELTREE cautiously. Every file and subdirectory within the specified
directory will be deleted.
7) FORMAT : -
Formats command is used to make a disk usable for operating system by dividing the
disk into tracks and sectors.
8) FDISK :-
This command is used to configure a hard disk for use with MS-DOS. We can use this
command to make partition of hard disk and can organize cylinder on it to store data.
Each partition of hard disk can have its own operating system.
C:\>Fdisk
It will display 4 options:
Current fixed disk drive: 1
When one select the option 1, further three options are displayed.
Choose one of the following:
9) LABEL :-
10) MORE :-
It displays output one screen (page by page) at a time. This command is used with DIR
and TYPE command.
11) MOVE :-
12) PRINT :-
13) SCANDISK :-
This command is used to repair & check various disk errors, file allocation table(FAT) &
other disk related errors.
14) SORT :-
This command sorts the data in alphanumeric order which can be ascending or
descending. This can be used with other commands by using pipe symbol in many
combinations.
15) SYS :-
This command is used to transfer system files to the target disk that is to make target disk
bootable by copying BIO.COM, IO.SYS, MSDOS.SYS, COMMAND.COM, DOS.COM
on the target disk. The BIO.COM and DOS.COM are hidden files.
16) XCOPY :-
17) DOSKEY :-