Dos Stud
Dos Stud
Q. What is MS-DOS?
Ans: -Microsoft Disk Operating System is full form of MS-DOS. It is system software. At
first operating system is Microsoft Disk Operating System from first introduce computer.
Microsoft is a software development company, which is the biggest software company of the
world. MS-DOS originally written by Tim Paterson and introduced by Microsoft in August
1981. It runs in 8KB. After that a lot of changes made in the MS-DOS software. MS-DOS
(Microsoft Disk Operating System) is a single-user, single-tasking computer operating
system. That can support only one user and only one task at a time. MS-DOS support CUI
(Character User Interface). MS-DOS control by the commands. Only Keyboard used in MS-DOS.
Types of MS-DOS COMMANDS
Any instruction given to the computer to perform a specific task is called command. The
DOS has several commands, each for a particular task and these are stored in DOS
directory on the disk. There are two types of MS-DOS commands: -
1. Internal Commands: -These are in built commands of MS-DOS i.e. these are stored in
Command interpreter file (COMMAND.COM). These commands enter into the computer memory
during computer booting. The internal commands are those commands that are
automatically loaded in the memory. To use these commands no external file is required
some commonly used DOS internal commands are. E.g. DATE, TIME, DIR, VER etc.
2. External commands: - An external command is an MS-DOS command that is not included
in command.com. This commands are not permanent part of the memory. To execute or run
this commands an external file is required. Some commonly used DOS external commands are
E.g. FORMAT, SYS, EDIT, TREE, SORT, PROMPT etc.
Q. What is the difference between internal and external commands?
Internal Command External Command
Internal commands are built in Command that External Commands are not contained to
pre-contained to the file “Command.com” the file “Command.com”
Internal command load on to memory at boot External commands do not load on to
time automatically. memory at boot time automatically. They
load when they are called.
Internal Command always loads on primary External Command only loaded by user
memory. request for execution.
All internal Commands remain available External commands do not available on to
on to memory un till power supply in on. memory it reside on disk.
Do not erase Internal Command. Erased this commands.
The working speed of this command is very Working speed is very slow.
fast.
The length of Internal Command is very The length of External Command is very
short. long.
How to Open Command Prompt
Method 1: - Start ->All Programs ->Accessories -> command prompt.
Method 2: - Start ->Run -> type cmd and click ok button.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 1
MS-DOS Prepared by Ashish Kumar
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 2
MS-DOS Prepared by Ashish Kumar
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 3
MS-DOS Prepared by Ashish Kumar
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 5
MS-DOS Prepared by Ashish Kumar
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 6
MS-DOS Prepared by Ashish Kumar
2. DIR/W: - By this command we can display width wise all files and directories name
list without time, size etc.
Syntax: -
D :\> DIR/W
Example:-
3. DIR/B: - Lists the subfolders/files names in bare format (no heading information or
summary).
Syntax: -
D :\> DIR/B
Example:-
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 7
MS-DOS Prepared by Ashish Kumar
6. DIR /AH: - By this command we can display the hidden file from the drive.
Syntax: -
D:\> DIR/AH
Example:-
7. DIR /A-H: -It shows all files and directories except hidden.
Syntax: -
D:\> DIR/A-H
Example:-
8. DIR /AR: -It shows all files and directories with read only attributes.
Syntax: -
D:\> DIR/AR
Example:-
9. DIR /A-R: -It shows all files and directories except read only files.
Syntax: -
D:\> DIR/A-R
Example:-
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 8
MS-DOS Prepared by Ashish Kumar
10. DIR /ON: -It shows all files and directories of current directory in
alphabetically name wise in ascending order.
Syntax: -
D:\> DIR/ON
Example:-
11. DIR /O-N: -It shows all files and directories of current directory in
alphabetically name wise in descending order.
Syntax: -
D:\> DIR/O-N
Example:-
12. DIR /OS: -It shows all files of current directory size wise in ascending order.
Syntax: -
D:\> DIR/OS
Example:-
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 9
MS-DOS Prepared by Ashish Kumar
13. DIR /O-S: -It shows all files of current directory size wise in descending order.
Syntax: -
D:\> DIR/O-S
Example:-
14. DIR /OD: -It shows all files and directories of current directory of date and time
in ascending order.
Syntax: -
D :\> DIR/OD
Example:-
15. DIR /O-D: -It shows all files and directories of current directory of date and
time in descending order.
Syntax: -
D :\> DIR/OD
Example:-
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 10
MS-DOS Prepared by Ashish Kumar
16. DIR/OE: -It shows all files and directories of current directory sorted extension
name in ascending order.
Syntax: -
D :\> DIR/OE
Example:-
D:\ASHISH> DIR/OE
17. DIR/O-E: -It shows all files and directories of current directory sorted extension
name in descending order.
Syntax: -
D :\> DIR/O-E
Example:-
D:\ASHISH> DIR/O-E
18. DIR/S: - By this command we can display directories name with sub directories and
files.
Syntax: -
D :\> DIR/S
Example:-
D:\Sonu> DIR/S
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 11
MS-DOS Prepared by Ashish Kumar
19. DIR/L: – It is an Internal Command. By this command we can display the file and
directories name with lower case.
Syntax: -
D :\> DIR/L
Example:-
D:\AJAY> DIR/L
Wildcards
Wildcards are symbols that enable you to perform an MS-DOS operation on more than one
file at a time. A file specification that contains wildcards can refer to more than one
file because it gives MS-DOS a pattern to match. MS-DOS searches for any file whose
filename or extension matches the pattern. There are two wildcard characters:
1)? -A question mark in a filename or extension means that up to a maximum of ONE
character/letter/number can occupy that position.
2)* - An asterisk in a filename or extension means that any number of
characters/letters/numbers, (up to maximum of EIGHT before the dot, and up to a maximum
of THREE after the dot) can occupy that position.
Ex:-
D:\ajay>DIR *.TXT : –By this command, we can display files name with ‘.txt’
extension name.
D:\Ajay> DIR C* :-All those files will displays that begins with letter 'C'.
D:\Ajay> DIR ?A? : -All those files will display that will consist of three letters
and second letter must be A.
Some Internal commands with wild card
COPY:-If we have to copy the songs from our Pen drive to our Hard disk. Then we
suppose E:\ is our Pen drive and we have to store all the songs in C:\ SONGS
directory.
Ex:-
C:\> COPY E:\ *.MP3 C:\ SONGS
DEL:- If we want to erase those files which have the extension of 'txt' from our disk
then we uses the command
Ex: -
C:\> DEL *.txt
22. Prompt: - Prompt is a common feature of DOS. Prompt is placed on the left hand side
of the screen and it tells that the computer is ready to accept instructions. DOS
commands are typed here. In MS-DOS the disk drives are normally represented by letter A:
B: C: D: etc and are followed by flashing cursor. This whole string is called Command
Prompt. Prompt is an internal command of DOS that allows the user to change the DOS
prompt. The default prompt is current drive and location followed by > Symbol.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 12
MS-DOS Prepared by Ashish Kumar
Syntax: -
D:\Ashish> Prompt $Option
Ex:-
D:\Ashish> Prompt $D
10-07-2017 Prompt $P$G
D:\Ashish>
23. Color: -The color command is an internal command . Sets the default console
foreground and background colors.
Syntax: -
D:\>COLOR [attr]
attr: -Specifies color attribute of console output
Color attributes are specified by TWO hex digits -- the first corresponds to the
background; the second the foreground. Each digit can be any of the below values.
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
Ex:-
D:\>Color 0A
Creates a Black background with light bright green text.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 13
MS-DOS Prepared by Ashish Kumar
2. MORE: - It is an External DOS command. 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:-
D:\> TYPE <File name> | MORE
D:\> More <File Name>
Example: -
D:\Ashish> TYPE Computer | MORE
There are a number of options written along with More Command i.e: -
i) /C: - Clear screen before displaying page.
Example: -
D:\Ashish> More/c Computer
ii) +n: - Start displaying the first file at line n.
Example: -
D:\Ashish> More +2 Computer
3. FC:-(File Compare) This command is capable for comparing two set of files and display
difference between two files.
Syntax:-
C:\> FC[/switch] <First set of file> <Second set of file>
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 14
MS-DOS Prepared by Ashish Kumar
Ex:-
a) FC/A: - It displays only first and last lines for each set of differences.
D:\Ashish>FC/A keyboard mouse
b) FC/B: - It performs a binary comparison.
D:\Ashish> FC/A keyboard mouse
c) FC/N: -It displays the line number on comparison.
D:\Ashish> FC/A keyboard mouse
3. Edit Command: - The edit command is an external command. The MS-DOS editor is a
command line text editor that allows you to view, create, or modify any file on your
computer. Edit meant Editor is very good utility for creating or modifying any file.
To start Edit type Edit on dos prompt (D:\>Edit) and press enter. Then a full
screen window will appear like this-
Menu bar: -A menu bar contains various commands. Which are given in detail. Select the
items from menu and click.
1.) FILE Menu (Alt+F):- We can activate File menu by pressing Alt+F key. File menu is
used to handle all the operations regarding file such as to create a new file, to
save a file,to open a file etc.
i) New :- New command open a new window for creating new file with file name Untitled.
ii) Open : - Opens a previously saved document.
How to open any file
Step 1: click on File. Or press Alt+F key.
Step 2: -The file menu will appear.
Step 3: -Choose open option.
Step 4: -Then press enter key.
Step 5: - A open dialog box will be appear.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 15
MS-DOS Prepared by Ashish Kumar
Step 6: -Enter a new file name in File Name field and press enter.
iv) Save As...:- To save and making another copy. This option is same like as copy
command of DOS.
v) Close: - To close active file.
vi) Print...:- Prints the active file.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 16
MS-DOS Prepared by Ashish Kumar
3) Search Menu (Alt+S):- This menu contains the items for searching and replacing the text of
document. This facility provide very powerful feature when we have to replace text with another
text in a large document.
ii) Repeat last find (F3):- From Find edit will search only once the text we type on the Find
What field. If we want to search same text , the we select Search->Repeat Last Find or just
press F3 button.
iii) Replace:- Edit gives the facility to search a text and replace that text with other upon your
choice. Suppose we want to replace all HEMAN we uses in current document with MACROMAN then we
select Replace from Search->Replace... and press enter. In appeared window we type HEMAN in Find
what field and type in MACROMAN in Replace with field.
Select Replace button to replace only first find text otherwise select Replace All to replace all
HEMAN with MACROMAN without asking any more for replace.
4) View Menu (Alt+V):- We can open more than a file into edit. We can open upto 9 files at a
time into editor. View option gives the facility to reload these currently loaded files. We can
display two files at a time after splitting current window in two parts. Both different window
may contain different files in each.
i) Split Window (Ctrl+F6):- As declared above that we can open two files at same time in two
different window. Place the cursor in the document after which we have to split the window and
select View->Split Window option.
ii) Resize Window (Ctrl+F8):- To change the size of each window we select this option. To change
the size of the selected window select View->Resize Window and press enter. The divider between
two files will change to resizable cursor, which can be move up or down using up and down arrow
key. To fix the size press enter key.
iii) Close Window (Ctrl+F4):- If you are not more need of two window, place the cursor in one
which you want to close and select View->Close Window. Second window will maximize to full screen
mode.
5) Option Menu (Alt+O):- This menu contains the items for changing settings for editor like
setting of printer port, tab spacing and color management.
i) Settings...:- This option is used for set tab spacing and printer port setting.
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 17
MS-DOS Prepared by Ashish Kumar
ii)Colors: - The editor windows contains different item such as window border, menubar, Normal text, selection
etc. We can change the background and foreground color of these item. A dialog box appear from where we
select the item and color as shown below.
6) Help Menu: -Using the Help menu we can get any help regarding any option of the editor.
5. DOSKEY:- It is an External DOS command .Once we install doskey , our dos will star to memorize all
commands we uses. We can recall those commands using up or down arrow keys. It also gives the facility to
create macros, which creates a short key for long keyword or command.
Key function for Doskey are given as-
UP,DOWN arrows recall commands
Esc clears current command
F7 displays command history
Alt+F7 clears command history
F9 selects a command by number
Alt+F10 clears macro definitions
Syntax:-
C:\> DOSKEY
DOSKey installed
Creating Macros:-
C:\>doskey t=time
C:\>t
C:\>time
Current time is 3:39:05.97p
Enter new time:
To list out all macros defined just type DOSKEY/MACROS at dos prompt and press enter.
C:\>DOSKEY/MACROS
D=date
T=time
6. MOVE:- 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>
Example: -
D:\Ashish> MOVE keyboard.txt D:\Alpha
1file(s) Movied.
D:\Ashish> MOVE *.Jpg E:\Wallpaper
11file(s) Movied.
7. XCOPY:- When we need to copy a directory instant of a file from one location to another the we
uses xcopy command. This command is much faster than copy command.
Syntax:-
C:\> XCOPY < Source dirname > <Target dirname>
Example: -
C:\> XCOPY D:\Ashish E:\Suraj
8. ATTRIB:- Sets the various type of attribute to a file. Like Read only, Archive, Hidden and System
attribute.
Syntax:-
C:\> ATTRIB [± r] [± a] [± h] [± s] <File name>
here r - for read only, a- for archive, h - for hidden, s - for hidden attribute.
C:\> ATTRIB +r Gulab.txt
This command will change the attribute of file gulab.txt to read only mode. To remove the read only
attribute we will follow this command.
C:\> ATTRIB -r Gulab.txt
Digital World Computer Centre Quamruddinganj Bihar Sharif hello-7677852516, 7004483874 Page 18