MS-DOS (Disk Operating System)
MS-Dos stands for Microsoft
Disk Operating System. It is a single-user operating system used
normally in PCs. It is a Non-graphic (CLI/CUI) Command line operating System. Today
DOS is no longer used, but windows OS provides a command line interpreter for
windows OS. We can use the command prompt to
execute the MS-DOS command. It does not support a mouse & Networking. It was used first in 1981.
The function of the Windows Operating system
- Process management
- Memory management
- I/O management
- File management
- Security & Protection
- Network Management
Differences between MS-DOS & Windows
Prompt:
Prompt means to display
one or more set of characters or symbols that indicates the computer is ready
for use. The user enters commands of MS-DOS after getting DOS prompt d:\>
is commonly called "D" Prompt.
Command:
A command is an order
or instruction which is given to the computer to perform a specific task and get
reliable output. There are two types of commands in MS-DOS.
a.
Internal Command
b.
External Command
Internal Command:
The commands which are
parts of the COMMAND.COM file of MS-DOS are called internal commands. These commands
are loaded into the computer's Memory at the time of booting the computer. They
are loaded in the memory till the computer is on. Examples of internal commands
are CLS, DIR, COPY, REN, MD, CD, DATE, TIME, etc.
External Command:
The commands which are
stored in a disk as individual program files are called external commands.
These commands are loaded into the computer's memory when used. Examples of
external commands are CHKDSK, DISKCOPY, TREE, FORMAT, etc.
Internal Command
1.
Clear
Screen (CLS)
syntax :
c:\>cls¿
Example :
c:\cls¿
2.
Display
and Change the Date
syntax
:
c:\>date¿
Current
Date: Tue 01/10/2023
Enter
the new date : (mm-dd-yy)_
Example:
C:\>date¿
Current
Date: Tue 01/10/2023
Enter the new date : (mm-dd-yy) 02/10/2023
3.
Display
and Change the Time
syntax
:
c:\>time¿
Current
Time: Tue 15:37:30.45
Enter
the new Time: _
Example:
c:\>time¿
Current
Time: Tue 15:37:30.45
Enter
the new Time: 16:25:10
4.
Display
files & Directories
Syntax:
C:\Dir¿ -
To display the list of files and Directories.
C:\>Dir/P¿ - To
display page wise
C:\Dir/W¿ - To
display wide wise
C:\Dir/S¿ -
To search files and sub-directories of the given path. You can search specified
files.
C:\>Dir/ON¿ - To
display in ascending order of file
C:\>Dir/OS¿ - To
display file size.
C:\>Dir/OE¿ - To
display file extension-wise.
C:\>Dir/OD¿ - To
display files date-wise.
C:\>Dir/OG¿ - To
display group-wise.
C:\>Dir/AD¿ - To
display directories only.
C:\>Dir/A-D¿ - To
display files only.
C:\>Dir/AA¿ - To
display files only.
C:\>Dir/AA¿ - To
display files only.
C:\>Dir/AH¿ - To
display hidden file attributes.
C:\>Dir/AS¿ - To
display System files.
C:\>Dir D:\¿ - To
display the files of E Drive.
5.
Creating a new file
Syntax:
C:\>Copy_Con_<Newfilename>
Note: File Name
contains Primary Name (Base Name) and Extension Name.
Example:
C:\>Copy_Con_test
¿
type something
about the file.
<Press F6
to save>
C:\>Copy_Con_test.txt
¿
C:\>Copy_Con_test.docx¿
C:\>Copy_Con_test.xlsx¿
C:\>Copy_Con_test.pptx
¿
C:\>Copy_Con_test.xls
¿
C:\>Copy_Con_test.mp3
¿
C:\>Copy_Con_D:\test.docx
¿ [Creating in D Drive]
6.
Display the content of the file
Syntax :
C:\>Type_<FileName>
¿
Example:
C:\>Type_test.txt
¿
7.
Making a Directory
Syntax :
C:\>MD_<DirectoryName>
¿
Example :
C:\>MD_Nepal ¿
C:\>MD_India ¿
C:>MD_China ¿
C:\> Dir ¿[to display the directories list]
8.
To
go inside the directory or change the directory.
Syntax:
C:\>CD_<DirectoryName>
¿
Example :
C:\>CD_Nepal ¿
9.
To
go up
syntax :
C:\DirectoryName>..¿ [One step up]
C:\DirectoryName>CD\¿ [jump in directory/drive]
Example1:
C:\Nepal>..¿
Result:
C:\>¿
10. Removing the Directory
Syntax :
C:\>RD_<OldDirectoryName>
¿
Example :
C:\>RD_Nepal ¿
C:\>RD_C:\Nepal
¿
Note: if Nepal is not empty, it cannot be deleted. to delete this directory, type
C:\>RD_C:\Nepal/s
¿
11.
Rename
a file
Syntax:
C:\>Ren_<SourceName>_<TargetName>
¿
Example:
C:\>Ren_Nepal.txt_itcomputer.txt
¿
C:\>Ren_D:\Nepal.txt
D:\itcomputer.txt ¿
12.
Delete the file
Syntax :
C:\>Del_<FileName> ¿
Example :
C:\>Del_Nepal.txt
¿
C:\>Del_D:\Nepal.txt
¿
13.
Copying
files
Syntax:
C:>Copy_<SourcePath>_<TargetPath>
Example:
C:\>Copy_C:\text.txt_D:\ ¿
14.
Display
Volume label
Syntax:
C:\>Vol ¿
15.
Display
Version
Syntax
C:\Ver ¿
16.
Display
active path
Syntax:
C:\>path=path_loacation ¿
Example
C:\>path=C:\Nepal.txt ¿
17.
Display
Volume
C:\>Vol_<Directory>
Example:
C:\>Vol_D: ¿
Important MS-DOS Command
Ip Address - ipconfig
Show Time - Time
Show Date - Date
Open Program - Start Program Application Name
Log Off PC - logoff
Short down - Shutdown /s
Check Disk for error - chkdsk
Scan System Drive - sfc /scannow
Save File - F6
Create Folder - MD_<Folder Name>
Delete Folder - RD_<Folder Name>
To Enter into Folder - CD_<Folder Name>
To Out From Folder - CD..
Rename Folder - REN_<Folder Name>/<Filename>
To Create File - COPY_CON_ <Filename.Extension>
To Delete File - DEL_Filename.extension
To Copy file - COPY_”Filename”_Path(D:\Foldername)
To Move file - Move_Filename_Path(D:\Foldername)
To Clear Screen - CLS
To Close MS DOS WIN - EXIT
Change MS Dos windows text color -A,B,C,D,E,F,1-7
How to change MS DOS Windows Text Color ?
· Open MS Dos Windows.
Note :
1=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
How to change MS DOS Windows Background Color ?
·
Open MS Dos Windows.
·
Type Color 27¿
27=Light Green
64=yellow
C6=pink
16=light blue
How to format Pen drive using command Prompt on
Windows 10 ?
·
Open MS Dos Windows .
·
Type diskpart ¿
·
Type list disk¿
·
Type select disk 1¿
·
Type list disk¿
·
Type clean¿
·
Type create partition Primary
¿
·
Type select partition 1¿
·
Type format fs=ntfs quick¿
·
Type active¿
· Type exit¿
How To Remove Write Protection From USB Pendrive ?
·
Open MS Dos Windows .
·
Step 1. Type " diskpart
" press Enter.
·
Step 3. Type " list disk
" press Enter
·
Step 4. Type " select
disk 2 " and hit Enter.
·
Step 5. Type " attributes
disk clear readonly " and hit Enter.
·
Step 6. Once the write protection
removal process completes, type " exit " to quit diskpart.
Batch File
A batch file is a small program file containing a
list of DOS Commands. This file helps to perform any task by using the series
of DOS Commands with the help of a single file name. This file name for the Batch
program can be given as a DOS file name, but we should have to give a .bat
extension. After making any batch file, you have to enter a file name at the
DOS prompt and have to press Enter key at once.
The batch program speeds up your work when you run it. it saves you time. You have to remember the file's name instead of several DOS Commands. And you don't have to retype multiple Commands. A batch file is a file containing a sequence of MS-DOS Commands, if you find that you are typing a sequence of commands repeatedly, you can save a lot of time by placing the commands in a batch file.
How to create batch file ?
- · Open notepad program
- · If you want to create batch file
you should type @echo at first
and type your command line.
- · For saving batch file you have to
type filename and extension name eg. Abc.bat
How to create folder using batch file ?
- ·
Open notepad program
- ·
Type D:
- ·
And md folder name
- ·
For saving batch file you have to
type filename and extension name eg. Abc.bat
How to Shutdown using batch file ?
- ·
Open notepad program
- · Type Shutdown /s
- ·
For saving batch file you have to
type filename and extension name eg. Abc.bat
How to Shutdown, Reboot, logoff program using batch
file ?
·
Open notepad program
·
Type
o @echo
OFF
o ECHO
"Choose an option .."
o ECHO
"1 = Logoff"
o ECHO
"2 = Reboot"
o ECHO
"3 = Hibernate"
o ECHO
"4 = Shutdown"
o SET
/p option=Choose one option-
o IF
%option%==1 SHUTDOWN /l
o IF
%option%==2 SHUTDOWN -r -t 10
o IF
%option%==3 SHUTDOWN /h
o IF
%option%==4 SHUTDOWN /s /f /t 0
o PAUSE
·
For saving batch file you have to
type filename and extension name eg. Abc.bat