0% found this document useful (0 votes)
196 views20 pages

Essential DOS Commands Guide

There are two types of DOS commands: internal commands that are preloaded into memory and external commands that are files run from disk. Internal commands include DIR, CLS, COPY, and DEL. External commands like XCOPY, CHKDSK, and FIND allow copying files between disks, checking disk status, and finding text in files. The AUTOEXEC.BAT file contains commands run at startup to set default settings and programs. Common commands are used to navigate directories, view files, create and delete files and directories, compare files, and check disks.

Uploaded by

shahabuddin khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
196 views20 pages

Essential DOS Commands Guide

There are two types of DOS commands: internal commands that are preloaded into memory and external commands that are files run from disk. Internal commands include DIR, CLS, COPY, and DEL. External commands like XCOPY, CHKDSK, and FIND allow copying files between disks, checking disk status, and finding text in files. The AUTOEXEC.BAT file contains commands run at startup to set default settings and programs. Common commands are used to navigate directories, view files, create and delete files and directories, compare files, and check disks.

Uploaded by

shahabuddin khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

DOS Commands

• DOS commands are mainly two types:


• 1. Internal commands
• 2. External commands

• Internal Commands are automatically loaded into the


computer memory when we switch on the computer. They do
not exist in the form of file in the directory

• External Commands are actually small utility programs. They


are not loaded automatically into the memory but must exist
in the form of file.
• Internal Commands list:
• 1. DIR (Disk Information Report)
• 2. CLS (Clear Screen)
• 3. MD (Make Directory)
• 4. CD (Change Directory)
• 5. COPY (copying one or more files to another file or location)
• 6. CD..
• 7.COPY CON (make file)
• 8. RD (Remove Directory)
• 9. DEL (Delete)
• 10.REN (Rename)
• 12.TYPE(To show the contents of existing file)
• External Commands list:
• 1. Edit 2.  XCOPY 3. chkdsk 4. Tree 5. Attrib 6. fdisk 7. find
External commands
Xcopy This command is used to copy files and directory trees
from one disk to another disk.
Syntax: XCOPY [source] [destination]
CHKDSK 
This command is used to check a disk and display a status
report with properties of disk like serial number, volume label,
memory and other properties along with errors on the disk.
FIND 
This command searches for a specific text string in a file or
files.
Syntax  FIND "string" [[drive:][path]filename[ ...]]
• APPEND
• Displays or sets the search path for data files. DOS will search the specified path(s) if the file
is not found in the current path. This has some creative uses, such as allowing non-CD
based games to be run from the CD, using configuration/save files stored on the hard drive.
• ASSIGN
• The command redirects requests for disk operations on one drive to a different drive. It can
also display drive assignments or reset all drive letters to their original assignments. The
command is available in MS-DOS 5.00.
• ATTRIB
• Attrib changes or views the attributes of one or more files. It defaults to displaying the
attributes of all files in the current directory. The file attributes available include read-only,
archive, system, and hidden attributes. The command has the capability to process whole
folders and subfolders of files.
• DEFRAG
• The command has the ability to analyze the file fragmentation on a disk drive or
to defragment a drive. The command is called DEFRAG in MS-DOS/PC DOS and diskopt in
DR-DOS. There is no Unix equivalent.
• EDIT
EDIT is a full-screen text editor, included with MS-DOS 5 and 6, OS/2 and Windows
NT to 4.0 The corresponding program in Windows 95 and later, and W2k and later
is Edit v2.0. PC DOS 6 and later use the DOS E Editor and DR-DOS used editor up to
version 7.
• FDISK
The FDISK command manipulates hard disk partition tables. The name derives
from IBM's habit of calling hard drives fixed disks. FDISK has the ability to display
information about, create, and delete DOS partitions or logical DOS drive. It can
also install a standard master boot record on the hard drive.
• FORMAT
Deletes the FAT entries and the root directory of the drive/partition, and
reformats it for MS-DOS. In most cases, this should only be used on floppy drives or
other removable media. This command can potentially erase everything on a
computer's hard disk.
• In MS-DOS there are two ways commands are executed.
An Internal command, which is a command embedded
into the command.com file, and an external command,
which is not embedded into command.com and
therefore requires a separate file to be used.
• For example, if your computer does not have the
fdisk.exe file and you try using the fdisk command, you
would receive an error "Bad command or file name"
error message. Fdisk is an external command that only
works if fdisk.exe, or in some cases, fdisk.com, is present.
AUTOEXEC.BAT batch file

• An autoexec.bat file contains MS – DOS commands which


are executed automatically when a personal computer
boots. This file is usually located in the roots directory of the
hard drive or floppy from which the computer boots up. The
autoexec.bat file is used to set various default setting and to
run programs that should be executed upon startup.
• The autoexec.bat file is one from of a batch file and it is
used to automate function in MS- DOS.
• In their simplest form, batch files contain MS-DOS
commands which include commands for such thing as loops
and execution branches and the like.
DIR Command
• Dir/p - page by page display of file name and
directory names;
• Dir/w - width-wise display;
• Dir/s - displays all sub directory and files in the
sub-directory of current directory.
Copy Con & MD
(To create file & Directory)

• Syntax:-  C:\> COPY CON <Filename>


Example:
C:\>COPY CON iamt.txt
A clock in a office can never get stolen
Too many employees watch it all the time
^Z
1 file(s) copied
 it creates a new directory in sub directory in the
current directory;
C:\> md <New directory name>
TYPE & Ren
• Type it displays the content of saved file; eg:
C:\> Type> file name.
C:\> Type iamt.txt
Ren this command changes the name of existing
file or directory:
Syntax: C:\> ren <old name> new name>
C:\>ren iamt.txt inmantec.txt
COPY
• Copy it copies the given file or files from the
source directory to the largest directory;
Syntax:C:\> copy<source file name> <target
file name>.
C:\> copy inmantec.txt a.txt
DELETE & RMDIR
(To delete file & directory)
• Delete delete a file from current directory; Syntax:
C;\> del<file name>
Del b.txt
• rd(rmdir) this command is used to remove a directory
from the disk; it can't remove a directory which
contains sub directory or files, ie, the child should be
removed from the parent; similarly this command
can't remove the current directory and root directory.
Syntax: c:\> RD<Dir name>.
External Commands
• MORE:-Using TYPE command we can see the content of any file. But
if length of file is greater than 25 lines then remaining lines will scroll
up. To overcome through this problem we uses MORE command.
Using this command we can pause the display after each 25 lines.
• Syntax:- C:\> TYPE <File name> | MORE
C:\> TYPE inmantec.TXT | MORE
or
C:\> DIR | MORE
• 2. MEM:-This command displays free and used amount of  memory in
the computer.
• Syntax:- C:\> MEM
the computer will display the amount of memory.
FC(File Compare)
• . FC:-(File Compare) This command is capable
for comparing two set of files and display
difference between two files.
• Syntax:- C:\> FC <First set of file>  <Second set
of file>
C:\> FC inmantec.TXT iamt.TXT
 Move command
•  Move command is used for moving one file or
multiple files from one location to another
location or from one disk to another disk.
• Syntax:- C:\> MOVE  <file name>  <path name>
C:\SONGS> MOVE   *.MP3   C:\ SONGS\OLD
SONGS\

C:\>
CHKDSK
• CHKDSK:-(Check disk) - This command is used
to check the status of a disk and show the
report of result status.
• Syntax:- C:\> CHKDSK

You might also like