You are on page 1of 10

DOS Commands

Commands are the way of communicating with


computers. Anything we want the computer system to do is
told in the form of commands in the predefined syntax.
DOS has two types of commands: -

# Internal Commands
# External Commands

Internal commands: -
These are those commands for which the code for
executing them is stored in COMMAND.COM and they
execute without the requirement of any other file. When an
internal command is issue by the user, the transient portion
knows what to do & executes that command.

External commands: -
These are the independent executable files that can be used
as separate utilities also.
Information about these files is also stored in the transient
portion. When an external command is issued, the transient
portion picks up the relevant file of that command &
executes it.
INTERNAL COMMANDS

1
1. Date – It displays the current system date & prompts you
to change the date, if necessary.

Syntax: C:\>date <mm-dd-yy>

2. Time – It sets the computer’s internal clock if command


is issued with parameters otherwise displays the system
time.

Syntax: C:\>time <hours: minutes: seconds: hundredths>

3. Clear Screen – It clears the screen. The cleared screen


shows only the command prompt & the blinking cursor.

Syntax: C:\>cls

4.Ver – Ver command displays the MS-DOS version no.

Syntax: C:\>ver

5. Vol: - It displays the current volume label and the serial


number of the specified drive. If drive specifier is omitted
Vol takes the current drive by default.

Syntax: C:\vol <d:>


(Internal Commands continued…………)

2
6. Break – It enables the DOS to check for Ctrl + C & Ctrl
– break as the signal to terminate the current program less
frequently. If you run Break without any parameters, the
current state of break checking is displayed.

Syntax: C:\>break <on/off>

7. MKDIR (or MD) – It creates a multilevel directory.

Syntax: C:\>MKDIR (or MD) <drive:> <path>

8. CHDIR (or CD) – It changes the current directory or


displays the name of the current directory.

Syntax: C:\>CHDIR (or CD) <drive:> < path>

9. Dir – It displays the list of the files & sub-directories that


are in the directory specified.

Syntax: C:\> dir <drive:> <path> <filename>

10. Copy – It copy one or more files to the location


specified & can also be used to combine.

Syntax: C:\>copy <source> <target>


(Internal Commands continued…………)

3
11. EDLIN – It is the line-oriented text editor.

Syntax: C:\>EDLIN <filename>

12. Del – It deletes the files specified.

Syntax: C:\>del <drive:> <path> <filename>

13. Prompt – It chanes the appearance of the command


prompt or displays the current prompt.

Syntax: C:\>prompt <text>

14. RMDIR (or RD) – It removes the directory.

Syntax: C:\>RMDIR (or RD) <drive:> <path>

15. Rename (or REN) – It changes the name of the file or


files specified & can also rename all files matching the
specified filename.

Syntax: C:\>rename (or REN) <drive:> <path>


<original filename> <changed filename>

(Internal Commands continued…………)

4
16.Type – It displays the contents of a text file or view the
contents of any text file without modifying it.

Syntax: C:\>type <drive:> <path> <filename>

17. Path – It is used to earch for the executable files in the


directories specified.

Syntax: C:\> path <drive:> <path> <……>

18. Verify – It verifies that the files are written correctly to


the disk.

Syntax: C:\>verify

Externel Commands

5
1. Attrib – It lets you display or alter the attributes assigned
to a file or directory.

Syntax: C:\>attrib <+A/-A><+H/-H><+R/-R><+S/-S>


<d:><path> <filename>

+A: - add archive attributes


-A: - remove archive attribute

+H : - add hidden attributes


-H: - remove hidden attribute

+R: - add read-only attributes


-R: - remove read-only attribute

+S: - add system attributes


-S: - remove system attribute

2. Chkdsk – It checks a disk’s file allocation table entries


for errors & find whether the files are o.k. or not.

Syntax: C:\>chkdsk <d:> <path> <filename>

(External Commands continued…………)

6
3. Comp – It compares two files byte-by-byte and reports
the differences.

Syntax: C:\>comp <d:>[<path+filename>]


<d:>[<path+filename>]

4. Format – It creates a new directory & file allocation


table for the disk.

Syntax: C:\>format <drive name>

5. Scandisk – It checks a drive for errors and corrects any


problems that it finds.

Syntax: C:\> scandisk <drive name>

6. Tree – The structure of the specified drive from the


specified directory down, listing all the sub-directories it
encounters is displayed graphically.

Syntax: C:\>tree <drive name>

(External Commands continued…………)

7
7. Deltree – It deletes a directory and all the files and sub-
directories contained within it.

Syntax: C:\>deltree <drive><path>

8. XCopy – It is used to copy all the files in a directory,


including the files in the sub-directories of that directory.

Syntax: C:\>xcopy <source> <destination>

9. Print – It prints a text file.

Syntax: C:\>print <filename>

10. FDisk – It is the tool, DOS provides for setting up and


managing hard disk partitions.

Syntax: C:\>fdisk

11. Label – It lets you create, modify or delete the label


assigned to a disk.

Syntax: C:\>label <drive name>

(External Commands continued…………)

8
12.Doskey – It edits command lines, recalls command lines
and creates macros.

Syntax: C:\>doskey

13.More – It displays one screen of output at a time and in


end of each screen displays the message.

Syntax: C:\>more <drive:> <path> <filename>

14. Backup – It lets the user to take the backup of hard disk
files to floppies.

Syntax: C:\>backup <source> <destination>

15.Restore – It restores the files that were backed up on a


floppy.

Syntax: C:\>restore <drive1> <drive2> <path> <filename>

16. Mem – It displays amount of used and free memory in


the system.

Syntax: C:\>mem
(External Commands continued…………)

9
17. FC – It compares two files or sets of files and displays
the difference between them.

Syntax: C:\>fc <drive><filename1> <drive><filename2>

10

You might also like