MS
DOS
Commands of MS DOS (Disk Operating System):
Example:
C:\ dir
Commands used with dir (directory) command:
I. Dir s*. *: This type of command is used for display any file starting with “S”
II. Dir ?????. *: This type of command is used for display any four character files.
III. Dir *. *: This type of command is used for display any file with any extension.
IV. Dir ali. *: This type of command is used for display a specified file with any extension.
Switches use with dir
command:
a) Using /p switch: By using this switch with dir we can view the files page wise.
Example:
C:\dir\p
b) Using /w switch: By using this switch with dir we can view the files width wise.
Example:
C:\dir\w
c) Using /w/p switch together: By using these switch we can view the files width wise and page wise.
Example:
C:\dir/w/p
d) Using /as switch: By using this switch we an view all system files.
Example:
C:\dir/as
e) Using /l switch: By using this switch we can view the files in lower case (small words).
Example:
C:\dir/l
f) Using /ah switch: By using this switch we can view the hidden files.
Example:
C:\dir/ah
g) Using /o switch: By using this switch we can view the files alphabetical order (sorting A-Z).
Example:
C:\dir/o
h) Using /b switch: By using this switch we can display the files and folder name only (Date and time will not display).
Example:
C:\dir/b
i)
Using /t switch:
Example:
C:\dir/t
j) Using /ad switch: by using this command we can display all subdirectory in the main directory or root directory.
Example:
C:\dir/ad
k) Using
/aa switch:
Example:
C:\dir/aa
Example:
C:\ cls
Example:
C:\time
Example:
C:\date
Example:
C:\ver
Example:
C:\vol
Example:
C:\label
Example:
C:\ mode 40
Example:
C:\mode 80
Example:
C:\prompit $p Ali $g
Example:
C:\prompt $p$g
Example:
C:\chkdsk
Example:
C:\mem
Example:
C:\doskey
Example:
C:\ren jan.txt ali.txt
Example:
C:\msd
Example:
C:\msav
Example:
C:\copy ali.txt A:
Example:
C:\move ali.txt A:
Example:
C:\del jan.txt
Example:
C:\undelete jan.txt
Example:
C:\md ali
Example:
C:\my document\cd Ali
C:\my document\ali\
Example:
C:\my document\ali\cd..
C:\mydocument\
Example:
C:\my document\rd Ali
C:\my document\
Note: Now check if directory is removed. Use cd command as follows
Example:
C:\my document\cd ali (directory has removed so following thing display’s)
“Bad command or file name”
Example:
C:\edit ali.txt
Example:
C:\format A:
a) Using /S switch: This switch is used with format command. It purpose is to transfer the system files in the disk after formatting the disk.
Example:
C:\format A:/s
b) Using
/Q switch: This switch is used with format command. It purpose is to
format the disk quickly. This switch can not be use first time of format.
Example:
A:\sys C:
Example:
C:\attrib +h ali.txt
Example:
C:\attrib –h ali.txt
Example:
C:\attrib +h+r ali.txt
Example:
C:\type ali.txt
Example for create the batch
file:
C:\edit ali.bat
To run the bat file simply writ the name of file and press enter to execute the commands store in batch file.
For example:
Example:
C:\help dir
(By writing above Example we can get help about directory).
Example:
C:\scandisk
Example:
A:\fdisk