DOS Commands
DOS Commands
• Directory structure
• DOS translate the command issued by the user in the format that
is understood by the computer to execute it, also generate the
error message in the human readable language.
• Directory is just like a file folder, which contain all the logically
related files.
C
Directory A B
A C C
B Sub
B
directory
C C
File in
subdirectory
Figure 1: Tree structure of directories
Classification of DOS Commands
dir read*.txt*
//Lists all files in the current directory that begin with
“read” & with extensions that begin with .txt such as .txt,
.txt1.
dir read * . *
// Lists all files in the current directory that begin with
“read” with any extension.
Internal DOS Commands
Use of wildcard characters with DIR command:
List of attributes:
• r : Read-only
• a : Archive file
• s : System file
• h : Hidden file
• i : Not – content indexed
• /s : Applies attrib for directory as well as subdirectories
• /d : Only applies for directory.
External DOS Commands
• ATTRIB :
Syntax: attrib + [option] file_name //To
set attribute
• For example,
To assign read-only attribute to report.txt file.
attrib +r report.txt