2. Choose one of the following options:
How to start MS-DOS
Important Tips
DOS Commands - Quick Review
Exit Tutorial
3. Starting MS-DOS Main Menu X
Press [win+r] from your keyboard to pop-up Run window.
Type [cmd] and press [Enter]
Now a command prompt window will appear.
4. Important Tips Main Menu X
In command prompt by default your are in system root drive (c:) with user account.
for example C:Documents And Settings
There are two types of commands External and Internal generally we use Internal commands.
By default your active drive is C, any command you enter is for active drive.
To have general help in command prompt type help and press enter or to get help for a
specific command type the name of command added with /?
for example tree/?
To repeat a command press upward arrow from keyboard.
To stop any processing command press Ctrl+C.
To copy any information displayed in command prompt go to the top left corner of command
prompt window and while clicking on it you get a menu, from there select Edit then Mark.
Now highlight the area of text you want to copy and press Enter. After pressing Enter your
selected text has been stored to clipboard. Now open any word processor or simply notepad
and paste copied data here(Ctrl+V) Show Images
Commands are always same whether you type in uppercase or lowercase.
Press Alt+Enter to run command prompt in full screen.
5. DOS Commands Main Menu X
Use all commands at your own risk.
Only some basic and frequently used commands are listed here.
Explanation and syntax of some commands is modified to make it simpler for non IT students.
Click a command to view its usage and examples.
ATTRIB CHKDSK DATE EDIT FORMAT HELP LABEL MD TIME
CLS DEFRAG EXIT TREE
COPY DEL
DIR
All commands are tested on windowXP sp2
with MS-DOS version 5.1.2600
6. ATTRIB Open BACK to
X
MS-DOS Command List
Changes or displays the attributes of a file.
SYNTAX
attrib drive:pathfile(with file extension) /switches
SWITCHES
+R Changes specified file to read-only, which means the file cannot be overwritten or erased
-R Changes specified file to read-write, which means the file may be overwritten or erased
+A Changes file setting to archived.
-A Changes file setting to not archived.
+H Changes specified file to hidden, which means the file will not be visible in explorer.
-H Makes hidden files visible again.
+S Marks specified file as system files (super hidden).
-S Removes system attributes from file.
EXAMPLE
attrib d:musicrehman.mp3 +s +h
attrib e:bollywallpapershotkatrina.jpg +r -h +a
7. CHKDSK Open BACK to
X
MS-DOS Command List
Analyzes, diagnoses, and optionally corrects common
hard-disk errors.
SYNTAX
chkdsk drive: /switches
SWITCHES
/f Enables auto-correction mechanism. When lost clusters are found.
EXAMPLE
chkdsk c: /f
chkdsk d:
8. CLS Open BACK to
X
MS-DOS Command List
Clears the dos screen.
SYNTAX
cls
SWITCHES
There are no switches for this command.
9. COPY Open BACK to
X
MS-DOS Command List
Copies and hence can overwrite files.
SYNTAX
Copy sourcedrive:pathfile targetdrive:path /switches
SWITCHES
/y Forces overwriting of existing files with same name, without prompting you to overwrite.
/-y Force DOS to prompt for conformation before overwriting existing files.
EXAMPLE
copy h:musicairtel.mp3 d:ringtone /y
copies airtel.mp3 from music folder in H drive to ringtone folder in D drive
without asking you to overwrite if it already exist there.
copy h:musicairtel.mp3 d:ringtone /-y
copies airtel.mp3 from music folder in H drive to ringtone folder in D drive. It
will prompt you for confirmation to overwrite existing file.
10. DATE Open BACK to
X
MS-DOS Command List
Displays the current date and prompts you to
enter another. To leave the date unchanged,
press Enter.
SYNTAX
date
SWITCHES
This command have no switches.
EXAMPLE
Date
Displays the current date and prompts you enter new.
11. DEFRAG Open BACK to
X
MS-DOS Command List
Speeds up disk performance by reorganizing
fragmented files.
SYNTAX
defrag sourcedrive: /switches
SWITCHES
-f Forces defragmentation
-a Analyze only
EXAMPLE
defrag h: -a
Only analyze H drive if there exists any fragmented files.
defrag h: -f
Force defragmentation on H drive.
12. DEL Open BACK to
X
MS-DOS Command List
This command can erase or overwrite your files.
Delete Files
SYNTAX
del sourcedrive:pathfile
SWITCHES
This command do not have any switches.
EXAMPLE
del h:musicairtel.mp3
deletes airtel.mp3 from music folder in H drive to
Use this command cautiously
13. DIR Open BACK to
X
MS-DOS Command List
Displays a list of files and
directories(folders) stored in a drive.
SYNTAX
dir sourcedrive:path /switches
SWITCHES
/a:d Displays all folders stored in the drive or path specified.
/a:h Displays all hidden files and folders stored in the drive or path specified.
/s Displays all folders with files contained in them in a sorted manner
EXAMPLE
dir h:music
Shows all files and folders stored in music folder on H drive
dir h:music /a:d
Shows only folders stored in music folder on H drive
dir h:music /a:h
Shows all hidden files and folders stored in music folder on H drive
dir h:music /s
Shows all folders (in music folder on H drive) with files contained in them
in a sorted manner
14. EDIT Open BACK to
X
MS-DOS Command List
It is a simple text editor for MS-DOS
It can also open a text file from specified location
for editing. (images)
SYNTAX
edit sourcedrive:pathfile
SWITCHES
This command do not have any switches.
EXAMPLE
edit
opens the editor window.
edit h:musicali.txt
opens the editor window with the file ali.txt stored in music folder of H
drive.
15. EXIT Open BACK to
X
MS-DOS Command List
It simply brings you out of the command prompt.
Exits MS-DOS
SYNTAX
exit
16. FORMAT Open BACK to
X
MS-DOS Command List
This command can format your whole drive with
a new file system.
SYNTAX
format sourcedrive: /switches
SWITCHES
/fs: Specify file system ntfs, fat or fat32.
/v: Specify new volume label.
/x Forces volume to dismount first if necessary. all opened handles to that volume will be
inaccessible.
EXAMPLE
format h: /fs:ntfs /v:misc /x
formats H drive by ntfs file system with new volume label as misc
Use this command cautiously
17. HELP Open BACK to
X
MS-DOS Command List
Displays help for various commands in MS-DOS.
SYNTAX
help
SWITCHES
There are no switches for this command.
18. LABEL Open BACK to
X
MS-DOS Command List
Adds or modifies a disk volume label.
SYNTAX
label sourcedrive:
SWITCHES
There are no switches for this command.
EXAMPLE
label H:misc
This will change volume label of H drive to misc.
19. MD Open BACK to
X
MS-DOS Command List
Creates a new folder at specified path.
SYNTAX
md sourcedrive:path
SWITCHES
There are no switches for this command.
EXAMPLE
md H:musicali_new
This will create a new folder in music folder of H drive by the name
ali_new
20. TIME Open BACK to
X
MS-DOS Command List
Display and allow changes to the system time.
SYNTAX
time
SWITCHES
There are no switches for this command.
EXAMPLE
time
This will display the current time and prompt you to enter new time.
If you do not want to change simply press Enter.
21. TREE Open BACK to
X
MS-DOS Command List
Display the file-folder structure of the drive
or folder specified.
SYNTAX
tree sourcedrive: /switches
SWITCHES
/f Includes the filenames in each subfolder.
EXAMPLE
tree h:
displays all folders with there subfolders of H drive.
tree h: /f
displays all folders with there subfolders and files contained in them of H
drive.