You are on page 1of 19

MS-DOS

ebook
for
Beginner
Developed by:
Ram Krishna Prasad
BCA from IGNOU, New Delhi
Email: ramaisgod@gmail.com
MS-DOS
MS-DOS stands for Microsoft Disk Operating system.
It activates all part of computer through disk.
It is text mode programme.
It is product of Microsoft company the latest version of MS-Dos was MS-Dos – 6.22 but
in this time the version of MS-Dos depend on windows. So windows is much popular
operating system.

When we start MS-DOS the such given type of symbol come.


Hard disk- C:\> or D:\>
Floppy disk- A:\>
B:\>
CD- E:\>
{\> - Prompt}
Booting:- The process which load all types of programme successfully in computer is
called booting.
Needs for booting file:-
IO. Sys
MS-Dos.com
Command .com

Programme:- It is set of instruction and command which gives computer work.

Command:- The instruction which is given to computer for do specified work is called
command.
There are two types of command.
a) Internal command
b) External command

a. Internal command:- The command which id part of command.com and for


execution or run no need extra file.
Ex- Date, time, vol, verson………

b) External command:- The command which is not part of command.com for


execution it needs extra file.
Ex- edit, find………

Dos prompt:-
C:\>
C- drive
: - colon
\ - slash
> - greater than sign
Some Commands
1. DATE:- This command is used to display currently system date and day and also ask
enter new date.
Syntax:- Date
i.g. C:\> date

2. TIME:- This command is used to display currently system time and also ask enter new
time.
Syntax:- Time
i.g C:\> time

3. VER:- This command is used to display the version of loaded operating system.
Syntax:- VER
i.g. C:\> ver

4. VOL:- This command is used to display the volume no. of computer and disk.
Syntax:- vol
i.g. C:\> vol

5. LABEL:- It is an external command which is used to change the name of volume label.
Syntax:- label
i.g. C:\> label

6. CLS:- This command is used to clear the screen of computer and move prompt on left
top corner.
Syntax:- cls
i.g. C:\> cls

7. EXIT:- This command is used to quit or exit from MS-Dos environment.


Syntax:- Exit
i.g. C:\> exit

8. COPY CON:- This command is used to create a file in desired directory and drive.
Syntax:- copy con [drive][path]<file name>
i.g. copy con ram
 Rule for file name:-
A. File name must be unique
B. File name can be divide into two part
a) Primary name- 8 character(first name)
b) Secondary name- 3 character (extension name)
C. Only one dot (.) can be used in file name between primary and secondary name.
D. No any blank space, no any symbol will be accepted.
C:\> D:
D:\>

9. TYPE:- This command is used to display the message or contains of file which can be in
any directory.
Syntax:- Type [drive][path]<file name>

10. DIR:- This command is used to display the list of files and directory.
Syntax:- Dir <directory name>
i.g. D:\> Dir
*To display the list of files and directory page wise
Dir/p*

11. DEL:- This command is used to delete the file.


Syntax:- Del [drive][path]<file name>
i.g. D:\> del ram.txt

12. COPY:- This command is used to the copy desired file trun one location to another.
Syntax:- Copy [drive][path]<source> [drive][path]<target>
i.g. D:\> copy ram Mohan

13. REN (RENAME):- This command is used to change the name of file in new name.
Syntax:- Ren [drive][path]<file name as on old> <new file name>
i.g. D:\> Ren ram Sohan
D:\> Type Sohan

14. MD (MAKE DIRECTORY):- This command is used to create directory.


Syntax:- MD [drive][path]<directory name>
i.g. MD Raja
15. CD (CHANGE DIRECTORY):- This command is used to change the directory.
Syntax:- CD <directory name>
i.g. D:\> CD Raja

D:\> Raja > CD…


D:\>
Example:-
RAMU

Kundan Chandan

Ramu ke under me kundan aur


Prakash Shippu Chandan ka directory banane
Process:- D:\> MD Ramu ke liye.
Niche.
D:\> CD Ramu Kundan ke under me Prakash
D:\Ramu> MD Kundan aur Shippu ka directory
D:\Ramu> MD Chandan banane ke liye
D:\Ramu> CD…

16. RD (REMOVE DIRECTORY):- This command is used to remove empty directory.


Syntax:- D:\> RD [drive][path]<directory name>
i.g. D:\> RD kiss\boy
D:\> RD kiss\girl
D:\> RD kiss

17. DELTREE:- It is an external command which is used to delete complete structure of


directory after conformation.
Syntax:- Deltree [drive][path]<directory name>
i.g. D:\> Deltree kiss
(are you sure to delete y/n) ? Y

18. MOVE:- It is an external command which is used to move or transfer files from one
location to another.
Syntax:- Move [drive][path]<source> [drive][path]<target>
i.g. Move kiss\boy\rani\kiss1.c kiss\boy\priti

19. XCOPY:- It is an external command which is used to copy complete structure of


directory.
Syntax:- Xcopy [drive][path]<directory or source name> [drive][path]<target>

a) /S:- This option copy which has files.


i.g. Xcopy fox mox/s
b) /E:- This option copy all files and directory with empty directory.
i.g. Xcopy fox mox1/E

c) /P:- To copy with conformation.


i.g. Xcopy fox mox2/E/P

20. PROMPT:- This command is used to change the style of prompt.


Syntax:- D:\> prompt $<exp-c>

a) $Q:- It changes prompt in equal(=) to sign.


i.g. D:\> prompt $Q
=
b) $L:- It changes prompt in less than (<) sign.
i.g. = prompt $L
<
c) $G:- It changes prompt in greater than sign.
i.g. <prompt $G
>
d) $B:- It changes prompt in pipe sign.
i.g. > prompt $B
;
e) $D:- It changes prompt style as Date.
i.g. ; prompt $D
Wed 05-18-05
f) $T: - It changes prompt in time.
i.g. Wed 05-18-05 prompt $T
11:30:15.40

g) $ <NAME>:- It changes prompt in given name.


i.g. 11:30:15:40 prompt $ AISECT
AISECT

h) $P$G:- It changes prompt in prompt style.


i.g. AISECT prompt $P$G
D:\>
If I give only $P:-
i.g. AISECT prompt $P
D:\

21. SORT:- It is an external command which is used to arrange the conents of file in desired
manner. It means ascending order and descending order.
Syntax:- Sort < <file name>
EX:-
D:\> copy con Rakesh
Mukesh
Ajay
Rajeev
To Z
i.g. Sort < Rakesh

a) /R:- To arrange the contents in descending order.


i.g. Sort < Rakesh/R

b) /+N:- It arranges the contents according to given character number


i.g. Sort <Rakesh/+2

22. D:\> COPY CON SAWAN:-


This is a box.
This is a pen.
This is blue pen……..
Find:- It is an external command which is used to find given string (word) in desired file.
Syntax:- Find “string” <file name>
i.g. D:\> Find “is” sawan

a) /V:- This option ignore which containg string.


i.g. D:\> Find “is” sawan/V

b) /N:- This option display line number which contains string.


i.g. D:\> Find “is” sawan/N

c) /I:- This option ignore case.


i.g. D:\> Find “is” sawan/I
d) /C:- i.g. Find “string” <file name>/C
23. EDIT:- It is an external command which is used to modification or editing in existed file.
Syntax:- Edit <file name>

 Edit command without file name open new file.

24. FILE + NEW OR (ALT+F+N):- This command is used to create new blank file.

25. FILE + SAVE OR (ALT+F+S):- This command is used to save currently active file.
Req step:-
a) Give File + Save command or Alt + F + S
b) Specify the name of file
c) Click on <Ok> button.

26. FILE + OPEN OR (ALT+F+O):- This command is used to open already existed file.
Req step:-
a) Give File + Open command or Alt + F + O
b) Select or specify file name
c) Click on <Ok> button.
27. FILE + SAVE AS OR (ALT+F+A):- This command is used to save the file with new
name.
Req step:-
a) Give File + Save As command
b) Specify file name
c) Click on <Ok> button.

28. FILE + CLOSE OR (ALT+F+C):- This command is used to close currently active file.

29. FILE + PRINT OR (ALT+F+P):- This command is used to print the message of file.

30. FILE + EXIT OR (ALT+F+X):- This command is used to exit or quit from edit
environment and move on dos prompt.

31. EDIT + CUT OR (CTRL+X):- This command is used to cut the selected string and
store in clipboard (Temporary storage area).
Req step:-
Select the string
Give edit + cut command
How to select any message:-
I method:-
a) Move cursor at desired position
b) Move mouse pointer at the position of cursor
c) Press mouse button and drag up to target.
II method:-
a) Move cursor at desired position
b) Press shift key and press arrow key.

32. EDIT + PASTE OR (CTRL+V):- To paste the string at desired position from clipboard.
Req step:-
a) Move cursor at desired position
b) Give edit + paste command.

33. EDIT + COPY OR (CTRL+C):- This command is used to copy the selected string and
store in clipboard.
Req step:-
a) Select message
b) Give edit + copy command.

34. EDIT + CLEAR OR (DELETE):- To clear or delete selected string from file.
Req step:-
a) Select message
b) Press delete key
35. SEARCH + FIND OR (ALT+S+F):- This command is used to search given string in
active file.
Req step:-
a) Move cursor at top or start of file.
b) Give search + find command
c) Specify find what string
d) Check mark in desired option by clicking
e) Click on <Ok> button.

36. SEARCH + REPEAT LAST COMMAND OR (F3):- This command is used to repeat
last command

37. SEARCH + REPLACE OR (ALT+S+R):- This command is used to replace finded


string into given string.
Req step:-
a) Move cursor at top of file
b) Give search + Replace command
c) Fill string in “find what” and replace with box
d) Click on <Replace> or <Replace all>
e) If I click on <Replace> then.......

38. VIEW + SPLIT WINDOW OR (ALT+V+S):- This command is used to split active
window in two equal part.

39. VIEW + SIZE WINDOW OR (ALT+V+I):- This command is used to split active
window in desired size.
Req step:-
a) Give View + Size window command
b) To decrease or increase press up and down arrow key.
c) Press inter key

40. VIEW + CLOSE WINDOW OR (ALT+V+C):- This command is used to close splited
window.

41. OPTION + SETTING OR (ALT+O+S):- This command is used to setting tab key.
Req step:-
a) Give Option + Setting command
b) Fill tab setting
c) Click on <Ok> button.

42. OPTION + COLOUR OR (ALT+O+S):- This command is used to change the colour of
back ground and fore ground.
Req step:-
a) Select back ground and fore ground colour
b) Click on <Ok> button.
1. MORE:- This command is used to display contents of files page wise.
Syntax:- <out put> ; more
i.g. Type abc ; more
i.g. Dir ; more

2. FILTER SYMBOL (<,>,>>):-


a) <:- It is used to display input as out put.
i.g. sort < abc
i.g. more < dir ; more
i.g. more < dir

b) >:- It is used to send out put as input.


i.g. Type abc > mnq

c) >>:- It is used to send out put as input with appending property.


i.g. Ver >> mnq

3. MODE:- This command is used to change configuration of screen of computer.


Syntax:- Mode <mode code>
i.g. D:\> mode 40
D:\>

4. FC (FILE COMPERE):- This command is used to compere tow files and display
message.
Syntax:- FC <file 1> <file 2>
i.g. D:\> FC abc mnq

5. ATTRIB:- This is an external command which is used to change the property of file as
hidden read only system.
Syntax:- Attrib <code> <file name>
D:\> Attrib +R abcd
D:\> Attrib +H abc
Code:-
+R:- Read only
-R:- Read & write
+H:- Hidden
-H:- Show
+S:- System
-S:- Remove system property
SOME IMPORTANT OPTIONS OF DIR
(DISK INFORMATION REPORT):-

a) /P:- It display list of files and directory page wise.


i.g. Dir/P

b) /W:- It display the list of files and directory width wise and in 5 columns.
i.g. Dir/W

c) /L:- To display list in lower case (small letter).


i.g. Dir/L

d) /B:- To display list without details.


i.g. Dir/B
i.g. Dir/B/P

e) /ON:- To display list name wise in assending order.


i.g. Dir/ON

f) /O-N:- To display list name wise in descending order.


i.g. Dir/O-N

g) /AB:- To display list only directory name.


i.g. Dir/AB

h) /OE:- To display list extension wise in assending order.


i.g. Dir/OE

i) /O-E:- To display list extension wise in assending order.


i.g. Dir/O-E

j) /OD:- To display the list date wise in assending order.


i.g. Dir/OD

k) /O-D:- To display the list date wise in descending order.


i.g. Dir/O-D

l) /OS:- To display the list size (byte) wise in assending order.


i.g. Dir/OS

m) /O-S:- To display the list size wise in descending order.


i.g. Dir/O-S
n) /AH:- To display the list of hidden.
i.g. Dir/AH

o) /AR:- To display the list of read only files.


i.g. Dir/AR

p) /AS:- To display the list of system files.


i.g. Dir/AS

q) /A:- To display the list with all hidden files.


i.g. Dir/A

r) /AD:- To display the list of only directories.


i.g. Dir/AD

s) /A-D:- To display the list of only files.


i.g. Dir/A-D

t) /S:- This option is used to search specified directory or files in active location.
Syntax:- Dir/S <name>
i.g. Dir/S/P Ramu

u) /V:- To display the list of files and directory.

v) /A-H:- It displays simple files and directory without hidden.

1. DOSKEY:- It is an external command which is used to store command line in buffer


(Temporary storage area).
It is used to develop or create short cut command.
Syntax:- Doskey
i.g. D:\> Doskey
Doskey installed.
EX:-
D:\> Date
D:\> Vol
D:\> Cls
2. F7:- This key is used to display the storage command.
D:\> Doskey/History

3. F8 OR AEROKEY:- This key is used to call desired command from buffer.


i.g. D:\> Ver

4. ALT + F7 OR D:\> DOSKEY%REINSTALL:- This key is used to remove previous


command from buffer and reinstall.
5. MACROS:-
Syntax:- Doskey <veriable>=command
i.g. D:\> Doskey T= Time
D:\> T

6. F9:- To run command through line number.


i.g. D:\> Line number 2

7. $T:- This is used to merge two command.


i.g. D:\> Doskey D= Date $T Time
D:\> D

8. $1 TO $9:- To accept veriable after command line.


As:- D:\> Doskey C= Copy con $1
D:\> C Radha

9. /MACROS:- To display or install macros.


i.g. Doskey/macros

10. ALT + F10:- To remove all macros from buffer.

1. BATCH FILE:- It is a programme file. Which holds executable command for execute
one by one.

 Note:- The default extension of batch file will be bat.


 Note:- If you have to create batch file than you must include extension of batch file other
wise it will not be batch file.
i.g. Copy con Ramu. bat
Date
Time
Vol
Ver
D:\> Ramu
D:\> Date
………..
D:\> Time

2. @:- It is used to hide command line.


i.g. D:\> Copy con Rahul.bat
@ Date
@ Time
@ Vol
@ Ver
D:\> Rahul

3. ECHO ON/OF:- It is used to hide or show set of command line.


i.g. Copy con Geeta.bat
@ Echo off
Date
Time
Echo on
Vol
Ver
D:\> Geeta

4. REM:- It is used to mark on command for not execution.


i.g. Copy con Swati. Bat
Date
Time
Rem Aisect
Vol
Ver
D:\> Swati

5. PAUSE:- To stop the execution up to press any key.


i.g. D:\> Copy con Prem. Bat
Dir
Pause
Cls
Pause
Ver
D:\> Prem

6. %1 TO %9:- To show first veriable after command line.


i.g. Copy con Rina. Bat
Copy con %1
i.g. D:\> Rina Raj
D:\> Copy con Raj

7. IF:- It is used to create a conditional branching within a batch file.


i.g. Copy con Raj. Bat
@ Echo off
If %1= = D Date
If %1= = T Time
If %1= = V Vol
If %1= = E Ver
D:\> Raj D

8. ECHO:- To print the message on the screen of computer.


i.g. D:\> Copy con RK. But
@ Echo off
Echo it is batch file
Copy con %1
D:\> RK SN

9. GOTO:- To move cursor at desired level.


i.g. Copy con RT. But
@echo off
If %1= = D goto ab
If %1= = V goto ac
If %1= = S goto ad
: ab
Date
Time
Goto E
: ac
Vol
Ver
Goto E
: ad
Dir
Label
:E
D:\> RT D
…………
D:\> RT V
…………
D:\> RT S
10. CHOICE:- It is used to accept desired number and store it within a veriable.
Syntax:- Choice C:<message>
D:\> Copy con Pooja. Bat
@echo off
Echo 1. date
Echo 2. time
Echo 3. vol
Echo 4. ver
Choice/C:1234
If error level 4 goto ab
If error level 3 goto bc
If error level 2 goto ac
If error level 1 goto an
:ab
Date
Goto E
:ac
Time
Goto E
:bc
Vol
Goto E
:ab
Ver
:E
D:\>Pooja
1. date
2. time
3. vol
4. ver
[1234]?1
D:\>

11. FILE:- A set as related information is called file.


There are two types of files:-
A. Document files
B. Programme files
a) Document files:- A file which holds any document like letter application are meaning
full sentence is called documents files.
b) Programme files:- A file which holds any programme file is called programme files.

 DIRECTORY:- A set as similar files is called directory.


Directory also contains sub-directory.
 SUB-DIRECTORY:- A directory within a directory is called sub-directory.
SOME IMPROTANT COMMAND:-
1. SCANDISK:- It is an external command which is used to check error of specify disk and
repair automatically.
Syntax:- Scandisk <drive>
i.g. Scandisk C:

a) /SURFACE:- It checks error surface wise.


i.g. Scandisk/surface

b) /CHECKONLY:- It only checks not repair.


i.g. Scandisk/checkonly

2. /AUTOFIX:- It checks specify disk and if there will be any error than fix.
Syntax:- C:\> Scandisk/Autofix <drive name>

3. SYS:- It is an external command which is used to copy all system file in desired disk.
Syntax:- Sys <disk name>
*To reboot the system after copying system file press Ctrl + Alt + Del*

(Format. exe)

4. FORMAT:- It is an external command which is used to create different sector and part in
active disk.
Note:- It means it will remove previous data files and system files and system files from
disk.
Syntax:- C:\> Format

5. UNFORMAT:- It is an external command. Which is used to unformatted format disk.

6. MEM:- It is an external command. Which is used to display the memory status of disk.
Syntax:- C:\> Mem

7. FORMAT:- It is an external. Which is used to check new track and sector in specified
disk. It also remove all also data of specified disk.
Syntax:- Format <drive name>

a) /U:- This option is used to unconditional formatting of specified disk.


Syntax:- Format/U <drive name>

b) /S:- This option is used to format specified disk and transfer system file in another
disk.
Syntax:- Format/S <Target disk name>
i.g. Format/S A:
c) /Q:- This option is used to perform quick formatting.
i.g. Format/Q

d) /V:- This option is used to with format command to specified volume label.
Ex:- Format A:/V: Ramu

8. DISKCOPY:- This command is used to copy complete message of specified disk in


another disk.
Both disk capacity will be same.
Syntax:- Diskcopy <source disk> <target disk>

9. DISKCOMP:- This command is used to compeare two disk and display difference
between then.
Syntax:- Diskcomp <Drive1> <Drive2>

10. CHKDSK:- This command is used to check states of specified disk and display details of
disk.
Syntax:- Chkdsk <drive name>
i.g. Chkdsk C:

11. PKZIP:- This is data comprocessing programme is used to comprocessed data file.
Syntax:- Pkzip[drive][path]<target><file name>
[Drive][Path]<Source><file name>

12. PKUNZIP:- This is data uncomprocessing programme. Which is compressed by pkzip


command.
Syntax:- Pkunzip[drive][path]<file>
i.g. Pkunzip C:\ Raj
.
INPORTANT COMMAND
 MSAVE:- This command is used to delete the virus and remove virus.
Syntax:- MSAVE C:

 VSAVE:- This command is used to see load the virus save programme in memory.
e.g.:- VSAVE

/V:- This command is used to with VSAVE command to unload virus save programme
from memory.
Ex:- VSAVE/V

 IPCONFIG:- This command is used to see the IP Address.


Top/IP 198.168.0
255.256.0
WS02

 PING:- This command is used to see the at tech terminal


C:-> ping <terminal name>
e.g. PING Wsol

 HELP:- This command is used to get help of any command.


Syntax:- help <command>
e.g.:- help edit

 DEFRAG:- This command is the disk optimizing programme which is used to optimize
specifild disk.
Syntax:- DEFRAG <Drive> [/F]
e.g.:- DEFRAG C:/F

 /F:- This option is used which defrag command to perform full optimization.

--The End--

You might also like