Tuesday, March 11, 2008






Operating system acts as an interface between the user and the computer. As explained earlier in Windows Operating System. It’s known as Character User Interface where we can only type the commands. It’s a single user interface i.e. only one user can work on this operating system.


To start Dos (Command Prompt) we have to follow these steps
· Click on Start Button
· Click on Programs
· Click on Accessories and select Command Prompt


Why You Need DOS
There are a variety of reasons why you need DOS. A few of them are listed below to satisfy your curiosity.

1. DOS controls the flow of information between you and the computer (translator).
2. DOS allows you to store information on your computer.
3. DOS allows you to retrieve information stored on your computer.
4. DOS interprets and translates the software you have on your computer.
5. DOS gives you access to all its function (i.e. saving, copying, and printing files).

Booting
The process of transferring the operating system (the three files IBMDOS.COM, IBMBIO.COM, COMMAND.COM) from the floppy into the computers memory is known as booting

System Floppy
The floppy which contains the three files IBMDOS.COM, IBMBIO.COM, COMMAND.COM is known as the system floppy or the DOS Floppy or Bootable disk.

Starting the Computer
• To start the computer, switch on the button on the CPU and the monitor.
• Once DOS is loaded the monitor shows A:\> prompt which means the computer is ready to accept your instructions (command) through Floppy
• If the computer has a hard disk the monitor will show you C:\> prompt. (You cannot see the hard disk because it is inside the CPU. A hard disk is a disk which can store a very large amount of information.)
• There are two types of DOS commands : Internal and External Commands

Internal Commands
When you boot the computer and the computer shows you the system prompt (i.e. A:\> or C:\>) you can give some commands. These commands are known as Internal Commands.

External Commands
Some commands are stored on the disk. These are called external commands. (i.e. if the commands are available on the disk, then you cannot give these commands.)

DATE
In order to see the date or change the date, you give the command DATE. The computer responds in this way:
The current date is: Thu 08/23/2007
Enter the new date: (mm-dd-yy)
Computers shows the last date given and asks for the new date. You have to enter month, then day and the year.

TIME
In order to see the time or change the time, you give the command TIME. The computer responds in this way:
The current time is: 10:59:18.01
Enter the new time:
You can change the time by giving the new time. You have to type hours, then minutes and then seconds.

CLS
The command CLS clears the screen

DIR
To see the content of a disk, you give the command DIR. This command shows all the files (directory).
C:\Documents and Settings\admin>dir
Volume in drive F has no label.
Volume Serial Number is 0861-5305
Directory of C:\Documents and Settings\admin
08/20/2007 10:31 PM <> .
08/20/2007 10:31 PM <> ..
08/21/2007 08:16 PM <> Desktop
08/22/2007 07:51 PM <> Favorites
08/23/2007 09:40 PM <> My Documents
07/02/2007 11:49 PM <> Start Menu
0 File(s) 0 bytes
6 Dir(s) 32,563,675,136 bytes free
The first Column shows the filenames and the extension. The second column shows the bytes occupied by the file. The third column shows the date files were created. The fourth column shows the time the files were created.

(File – Anything you store on the computer is called a file. The name given to a file is called a filename. Filename – is 1 to 8 characters long. A filename can have alphabets and numbers. Blank spaces are not allowed in a filename. Extension – is upto 3 characters long and is optional. Byte – can store 1 character.)

DIR/P
Dir/p shows the directory one screen at a time. It will show a screen full of files and pause. To see the next screen press any key

DIR/W
Dir/w shows the directory widthwise. It will only show the filename and the extension.

DIR/S
Dir/s searches the current or specified directory and all subdirectories

DIR/S/P
Dir/s/p shows the current or specified directory and all subdirectories page wise.

DIR/W/P
Dir/w/p shows the directory width and page wise on the screen.

Wild Cards
? (Question Mark) and *(Asterisk) are known as wildcards. ? Occupies any one character. E.g. DIR ?ab will show all the files with any one character and ending with ab. * occupies any number of characters. E.g. *.com will show all the files with any filename but ending with com.

What is a directory?
A floppy or hard disk can store a lot of times. If we are looking for a particular file it takes a long time to search for that file. Therefore we divide the disk into different compartments called directories. E.g. a cupboard. It is divided into a number of drawers. Each drawer stores different types of files. If we want a particular file, we will go to a particular drawer and search for the file instead of searching the whole cupboard.

MD NAME
MD means Make Directory
e.g. MD Computer
Creates a sub-directory called Computer. In this directory Computer will store all his files.

CD NAME
CD means Change Directory.
e.g. CD Computer
Allows you to change into the sub – directory. The main directory is called the root directory. If you want to move from the sub – directory to the root directory the command is CD\ and CD.. takes you out of one directory

RD NAME
RD means Remove Directory. This command removes the sub – directory. A directory can be removed only if 1) the directory is empty i.e. there are no files in the directory and 2) you should be out of the directory. E.g. RD Computer

COPY
Copy command is used to copy a file from one directory to another. To copy a file you should know the source (from where to copy) and the destination (where it has to be copied).
e.g. COPY C:\> AB.TXT D:\>
COPY AB.TXT XY.TXT
COPY AB.TXT C:\COMPUTER>
SYNTAX
COPY FROM TO
COPY

If you want to create a file, you give the command COPY CON and the file name. Then you type what you want. After typing press F6 or CTRL + Z to save.
e.g. COPY CON ABCD.TXT
TODAY IS A GREAT DAY. (press enter)
IT IS SHINING TODAY (press enter)
^Z
1 files(s) copied

TYPE
This command displays the contents of a file.
e.g. TYPE ABCD.TXT

EDIT
If you want to make any changes in a file, then you use EDIT command. EDIT means to make change.
So to make changes in the file directly, do as given below:-
e.g. EDIT ABCD.TXT

REN (RENAME)
This command allows you to change the name of a file.
e.g. REN ABCD.TXT XYZ.TXT
Where ABCD.TXT will change to XYZ.TXT

VER
This command allows you to find which version of DOS you are using since there are different versions of DOS.

VOL
This command shows you the label (name) of the floppy.


PROMPT
To get a different prompt other A:\> you use the prompt command. The following combinations can be used.
$N – for the drive
$G – greater than sign
$L – less than sign
$D – for current date
$T – for current time
$P – for drive and directory
e.g. PROMPT $P$G
PROMPT HI$G

DELTREE
Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of such a drastic action.
deltree [/y] directory The /y parameter if present tells the deltree command to carry out without first prompting for confirmation.
The deltree command is not included in recent Microsoft Windows operating systems.

CHKDSK
Verifies a hard disk or a floppy disk for file system integrity.
Options:
/F : Fixes errors on the disk
/V : Displays the full path and name of every file on the disk
chkdsk drive [[path]filename] [/F] [/V]


ATTRIB
Change or view the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory.
Options:
To add an attribute attach a '+' in front of it.
To remove an attribute attach a '-' in front of it
Attributes include
R - Read-only
A - Archive
S - System
H - Hidden
attrib [+-ahrs] [filespec]

MEM
Displays the memory usage.

SCANDISK
Disk diagnostic utility
Scandisk is a replacement for the chkdsk utility. Its primary advantages over chkdsk is that it is more reliable and has the ability to run a surface scan which finds and marks bad clusters on the disk. It is present on 16/32-bit MS-DOS-based versions of Windows like Windows 95, 98, 98SE, and Me. chkdsk has surface scan and bad cluster detection functionality built in on Windows NT based operating systems.

FORMAT
Delete all the files on the disk and reformat it for MS-DOS
In most cases, this should only be used on floppy drives or other removable media. This command can potentially erase everything on a computer's hard disk.
/autotest and /backup are undocumented features. Both will format the drive without a confirmation prompt.

Format /?
Formats a disk for use with Windows XP.

FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X]
FORMAT volume [/V:label] [/Q] [/F:size]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors]
FORMAT volume [/V:label] [/Q]
FORMAT volume [/Q]
volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:filesystem Specifies the type of the file system (FAT, FAT32, or
NTFS).
/V:label Specifies the volume label.
/Q Performs a quick format.
/C NTFS only: Files created on the new volume will be
compressed by default.
/X Forces the volume to dismount first if necessary.
All opened handles to the volume would no
longer be valid.
/A:size Overrides the default allocation unit size. Default settings
are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K,
64K. FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K, (128K, 256K for sector size > 512 bytes).

Note that the FAT and FAT32 files systems impose the
following restrictions on the number of clusters on a volume:
FAT: Number of clusters <= 65526

FAT32: 65526 <>

Change the DOS Prompt Color in a Batch File

If you need a batch file to really grab your attention, such as when an error condition occurs, try changing the DOS prompt's colors. The COLOR command changes the colors of the DOS prompt text and (optional) background. COLOR takes a one or two-character argument. With one character, you can specify the text color. With two characters, the first character specifies the color of the background, and the second character the text color. The characters and colors are as follows:

0 = Black
1 = Blue
2 = Green
3 = Aqua
4 = Red
5 = Purple
6 = Yellow
7 = White
8 = Gray
9 = Light Blue
A = Light Green
B = Light Aqua
C = Light Red
D = Light Purple
E = Light Yellow
F = Bright White

Questions

Q. What is the format for Date in DOS?
Q. How do we view the name or label of a drive in DOS?
Q. How to change the Drive in DOS?
Q. What is the full form of CD?
Q. What is the full form of MD?
Q. Which command helps you in making a text file?
Q. What is the function of MODE command in DOS?
Q. What is the function of cd\, cd.. and cd directoryname? Explain in detail.
Q. Explain date command in detail
Q. Explain time command in detail.
Q. What is the difference between * and ? characters? What are they known as?
Q. What is the difference between dir/p and dir/w?
Q. How to see the contents and making changes in the file?
Q. What is the difference between dir *.doc and dir l*.doc?
Q. How do you remove a directory?
Q. What is System Floppy?
Q. What is a file?
Q. What is a directory?
Q. How will you create a sub – directory called RAVI in the directory RAJ?
Q. What is the use of DIR command?
Q. What is command to copy a file XYZ to XY?
Q. What command will you give to see the contents of a file XY.TXT?
Q. What is the command to erase a file AB?

Fill in the Blanks

In order to see the date or change the date, you give the command DATE

The command CLS clears the screen.

To see the contents of a disk, you give the command DIR

CD allows you to change into the sub – directory.

Remove Directory command removes the sub directory.

Copy command is used to copy a file from one drive or one directory to another.

VER command allows you to find which version of DOS.

VOL command shows you the label (name) of the floppy.

No comments: