Computer Practical
Computer Practical
Computer Practical
Filename . Extension
Primary name . Secondary Name
The command available are all combined together and are stored in Command.com file, which is a executable
command file. These internal command are further grouped according to their properties. These are as follows.
1. CLS
7. COPY CON
2. DIR
8. TYPE 12. MD
3. VER
9. COPY 13. CD
4. VOL
10. REN 14. RD
5. DATE
11. DEL
6. TIME
Pr 4: External command
External command: An external command is an MS-DOS command that is not included in cmd.exe. External
commands are commonly external either because they require large requirements or are not commonly used
commands.
External commands are known as Disk residence commands. Because they can be store with DOS directory or any
disk which is used for getting these commands. Theses commands help to perform some specific task. These are
stored in a secondary storage device. Some important external commands are given below-
MORE MOVE FIND DOSKEY MEM FC DISKCOPY
FORMAT SYS CHKDSK ATTRIB XCOPY
SORT LABEL
1. MORE:-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:- C:\> TYPE <File name> | MORE
C:\> TYPE ROSE.TXT | MORE
or
C:\> DIR | MORE
2. MEM:-This command displays free and used amount of memory in the computer.
Syntax:- C:\> MEM
the computer will display the amount of memory.
3. SYS:- This command is used for copy system files to any disk. The disk having system files are known as
Bootable Disk, which are used for booting the computer.
Syntax:- C:\> SYS [Drive name]
C:\> SYS A:
System files transferred
This command will transfer the three main system files COMMAND.COM, IO.SYS, MSDOS.SYS to the floppy
disk.
4. 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>
C:\> XCOPY TC TURBOC
5. 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>
C:\SONGS> MOVE *.MP3 C:\ SONGS\OLD SONGS\
C:\>
6. FC:-(File Compare) This command is capable for comparing two set of files and display difference between two
files.
Syntax:- C:\> FC <First set of file> <Second set of file>
C:\> FC ROSE.TXT GULAB.TXT
7.CHKDSK:-(Check disk) - This command is used to check the status of a disk and show the report of result status.
Syntax:- C:\> CHKDSK
C:\>CHKDSK
CHKDSK has NOT checked this drive for errors.
You must use SCANDISK to detect and fix errors on this drive.
Volume JAI created 10-19-2001 7:14p
Volume Serial Number is 3E42-1907
4,203,073,536 bytes total disk space
381,988,864 bytes available on disk
4,096 bytes in each allocation unit
1,026,141 total allocation units on disk
93,259 available allocation units on disk
651,264 total bytes memory
610,784 bytes free
Instead of using CHKDSK, try using SCANDISK. SCANDISK can reliably detect
and fix a much wider range of disk problems.
8. SORT:- This command is useful when we want to sort a file. When we run this command the result can be get to
display device or file.
Syntax:- C:\> SORT /R < Input file name> <output file name>
Suppose we have a file Player.txt which having the list of a cricket player team and we want to sort the list of
players, then we uses this command
C:\> SORT Player.txt If we not specify the output file
name then result will show to the screen.
/R- switch is used for sorting the file in descending order like from Z to A or from 9 to 0.
9. FIND:- The FIND command is used to search a file for a text string.
Syntax:- C:\> FIND "String to search" <File name>
C:\TEST>find "office" gulab.txt
---------- gulab.txt
A clock in a office can never get stolen
10. DISKCOPY:- DISKCOPY copies the contents of a floppy disk to another.
Syntax:- C:\> DISKCOPY <Drive1> <Drive2>
C:\> DISKCOPY A: B:
This command will be copy all contents of A drive to B drive.
11. 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
12. LABEL:- If you are not happy with the volume label of hard disk, you can change it.
Syntax:- C:\> LABEL
C:\>LABEL
Volume in drive C is JAI
Volume Serial Number is 3E42-1907
Volume label (11 characters, ENTER for none)? INFOWAY
13. DOSKEY:- 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
14. FORMAT:- This command creates new Track & Sectors in a disk. Every
Syntax:- C:\> FORMAT [drive name] [/S]
C:\> FORMAT A:
this command will create new track & sectors.
C:\> FORMAT A: /S
This command will transfer system files after formatting the disk.
Pr 1: Introduction to DOS Command
When we start MS-DOS, we get a symbol on the screen like this
C:\>
This symbol is known as C drive or C-prompt. similarly A:\> is called A-prompt or A drive. Generally A:\ is used as
floppy drive i.e. when we are working on floppy disk and C:\ is used for local disk or hard disk. A small blinking bar
we see on the screen. This is cursor. It is waiting for your instruction. There few predefined words for DOS. These
are known as DOS-Commands. Our operating system can understand only these predefined commands.
These DOS-Commands are divided into two parts.
Internal Commands External Commands
A file may be known as container of information on a particular topic. A directory may be considered as a structure
or a cabinet which keeps one or more files.
Directories are usually creates for keeping one or more identical files together. Every file have a filename which
helps to recognize them. these are divided into two parts
File name or Primary name
Extension or Secondary name
The primary name can be from 1 to 8 characters long. The extension contains 1 to 3 characters long. A filename and
extension are separated by using a dot symbol. Thus it's structure looks like
Filename . Extension
Primary name . Secondary Name
The command available are all combined together and are stored in Command.com file, which is a executable
command file. These internal command are further grouped according to their properties. These are as follows.
1. CLS
7. COPY CON
2. DIR
8. TYPE 12. MD
3. VER
9. COPY 13. CD
4. VOL
10. REN 14. RD
5. DATE
11. DEL
6. TIME
Pr 4: External command
External command: An external command is an MS-DOS command that is not included in cmd.exe. External
commands are commonly external either because they require large requirements or are not commonly used
commands.
External commands are known as Disk residence commands. Because they can be store with DOS directory or any
disk which is used for getting these commands. Theses commands help to perform some specific task. These are
stored in a secondary storage device. Some important external commands are given below-
MORE MOVE FIND DOSKEY MEM FC DISKCOPY
FORMAT SYS CHKDSK ATTRIB XCOPY
SORT LABEL
1. MORE:-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:- C:\> TYPE <File name> | MORE
C:\> TYPE ROSE.TXT | MORE
or
C:\> DIR | MORE
2. MEM:-This command displays free and used amount of memory in the computer.
Syntax:- C:\> MEM
the computer will display the amount of memory.
3. SYS:- This command is used for copy system files to any disk. The disk having system files are known as
Bootable Disk, which are used for booting the computer.
Syntax:- C:\> SYS [Drive name]
C:\> SYS A:
System files transferred
This command will transfer the three main system files COMMAND.COM, IO.SYS, MSDOS.SYS to the floppy
disk.
4. 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>
C:\> XCOPY TC TURBOC
5. 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>
C:\SONGS> MOVE *.MP3 C:\ SONGS\OLD SONGS\
C:\>
6. FC:-(File Compare) This command is capable for comparing two set of files and display difference between two
files.
Syntax:- C:\> FC <First set of file> <Second set of file>
C:\> FC ROSE.TXT GULAB.TXT
7.CHKDSK:-(Check disk) - This command is used to check the status of a disk and show the report of result status.
Syntax:- C:\> CHKDSK
C:\>CHKDSK
CHKDSK has NOT checked this drive for errors.
You must use SCANDISK to detect and fix errors on this drive.
Volume JAI created 10-19-2001 7:14p
Volume Serial Number is 3E42-1907
4,203,073,536 bytes total disk space
381,988,864 bytes available on disk
4,096 bytes in each allocation unit
1,026,141 total allocation units on disk
93,259 available allocation units on disk
651,264 total bytes memory
610,784 bytes free
Instead of using CHKDSK, try using SCANDISK. SCANDISK can reliably detect
and fix a much wider range of disk problems.
8. SORT:- This command is useful when we want to sort a file. When we run this command the result can be get to
display device or file.
Syntax:- C:\> SORT /R < Input file name> <output file name>
Suppose we have a file Player.txt which having the list of a cricket player team and we want to sort the list of
players, then we uses this command
C:\> SORT Player.txt If we not specify the output file
name then result will show to the screen.
/R- switch is used for sorting the file in descending order like from Z to A or from 9 to 0.
9. FIND:- The FIND command is used to search a file for a text string.
Syntax:- C:\> FIND "String to search" <File name>
C:\TEST>find "office" gulab.txt
---------- gulab.txt
A clock in a office can never get stolen
10. DISKCOPY:- DISKCOPY copies the contents of a floppy disk to another.
Syntax:- C:\> DISKCOPY <Drive1> <Drive2>
C:\> DISKCOPY A: B:
This command will be copy all contents of A drive to B drive.
11. 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
12. LABEL:- If you are not happy with the volume label of hard disk, you can change it.
Syntax:- C:\> LABEL
C:\>LABEL
Volume in drive C is JAI
Volume Serial Number is 3E42-1907
Volume label (11 characters, ENTER for none)? INFOWAY
13. DOSKEY:- 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
14. FORMAT:- This command creates new Track & Sectors in a disk. Every
Syntax:- C:\> FORMAT [drive name] [/S]
C:\> FORMAT A:
this command will create new track & sectors.
C:\> FORMAT A: /S
This command will transfer system files after formatting the disk.
PR 1: OPEN, CLOSE, CREATE and Modify A DATABASE
1. TO OPEN A DATABASE:
Syntax: use <dbname> Ex: use book
2.TO CLOSE THE DATABASE:
Use
To close the current opened database.
Close all
To close the all opened database.
3. To CREATE NEW DATABASE:
Syntax:
crea <dbname> create <dbname> Ex:
crea book
PR7:Replace command
To replace the content of the specified field in the database table. i.e., This command can be used
to remove the data in the particular field (nullifying / empty a field)
e.g.
REPLACE fieldname WITH ""
- To replace with null value
REPLACE fieldname WITH { / / }
- To replace the date field with null value
REPLACE ALL QUANTITY WITH 0
- Replaces the data in the quatity fied with 0 in all the records.
REPLACE ALL PRICE WITH PRICE+50
- Adds 50 to the price field.