100% found this document useful (1 vote)
443 views5 pages

Lab Experiment No.02: Introduction To Computing (COMP-01102) Telecom 1 Semester

This document provides instructions for a lab experiment on familiarization with the DOS environment and its important commands. It introduces DOS and describes important commands for changing and working with drives, directories, files, and disk management. Examples are provided for commands like DIR, CD, MD, RD, COPY, REN, DEL, TYPE, FORMAT, CHKDSK and VER. Home tasks at the end provide practice exercises for students to write DOS commands.

Uploaded by

ASIS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
443 views5 pages

Lab Experiment No.02: Introduction To Computing (COMP-01102) Telecom 1 Semester

This document provides instructions for a lab experiment on familiarization with the DOS environment and its important commands. It introduces DOS and describes important commands for changing and working with drives, directories, files, and disk management. Examples are provided for commands like DIR, CD, MD, RD, COPY, REN, DEL, TYPE, FORMAT, CHKDSK and VER. Home tasks at the end provide practice exercises for students to write DOS commands.

Uploaded by

ASIS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Introduction to Computing (COMP-01102) Telecom 1stSemester

LAB EXPERIMENT NO.02


Familiarization with DOS environment and its important commands

Name:Muhammad Amir Signature & Grade: ___________________


Roll No:20TC1016 Date : _______________________________

OBJECTIVE:

 To become familiar with the DOS environment

EQUIPMENT REQUIRED:
 Desktop Computer

INTRODUCTION:
DOS, the acronym for Disk Operating System, is an operating system with a command-lineinterface
used on personal computers. It provides a set of commands that enables the users toaccess or
manipulate information on their disks, as well as simply interact with theircomputer.

Figure 1: DOS environment


DOS commands are of two types namely internal commands and external commands.
 Internal commands are those which are built into command.com.
 External commands are those that must be located from a file loaded by command.combefore
it can be executed.
A brief description of important DOS commands is given below:

Department of Information & Communication Engineering 1


Introduction to Computing (COMP-01102) Telecom 1stSemester

Changing drive
Type drive letter of the drive to which you want to switch to, on the command promptfollowed by‘:’
Example: c:>d:This will change the current drive from C to D.
Result: d:>
Wild Cards
DOS recognizes two wild cards:
 The asterisk (*) represents one or more characters that a group of files has in common.
 The question mark (?) represents a single character that a group of files has in common.

Working with Directories


 dirto view the contents of a directory
Prompt on screen: drive:>
Syntax: dir
Example: c:>dir This will list all the files and subdirectories on drive C, which
isbeing prompted on screen. If another drive needs to
beaccessed, first change the drive, as previously explained
andthen enter the dircommand.
Use wild cards to display selected lists. For example:
o dir *.* Displays all files and subdirectories on the drive
o dir ?????.com Displays all files having names up to five characters
andextension com’

dircommand can be modified using these wild cards and other switches as follows sothat only one
screen of selected information is displayed at a time.
o dir/p Lists the directory contents page wise.
o dir/w Lists the directory contents in a wider format, that is, only file
namesand extensions.
o dir/w/p Lists the directory contents in a wider format, page wise.

 cd to change from one directory to another


Prompt on screen: drive:>
Syntax: cd drive:\path
Example: c:>cd dos This will change the current directory from the root directory to
‘dos’ directory on the prompted drive C.
Result: c:\dos>

 md to create a new directory


Prompt on screen: drive:>
Syntax: md drive:\path\dirname
Example: c:>md neduet This will create a new directory, named ‘neduet’ on the
drive being prompted, in this case drive C.

 cd.. to switch back one level up in the directory structure


Prompt on screen: drive:>
Syntax: cd..
Example: c:\dos\subdos>cd..This will switch back to the directory, ‘dos’
from the current directory, ‘subdos’ of theprompted drive C.
Result: c:\dos>

Department of Information & Communication Engineering 2


Introduction to Computing (COMP-01102) Telecom 1stSemester

 cd\ to switch back to the root drive directory


Prompt on screen: drive:>
Syntax: cd\
Example: c:\dos\subdos>cd\ This will switch back to the root drive, C
Result: c:\>

 rdto remove a directory


Prompt on screen: drive:>
Syntax: rd drive:\path\dirname
Example: c:\>rd neduet This will delete the directory, named ‘neduet’ from the
prompted drive C.
Note that rddoesn’t delete folders having subdirectories. For that purpose rd/s is to beused

 treeto view directory listing in a hierarchical structure.


Prompt on screen: drive:>
Syntax: tree drive:\path
Example: tree d: This will display the hierarchical directory structure of drive D.
Use /f to display the names of the folders as well as the files in each folder, in ahierarchical
manner.

Working with Files


 copy to copy a file from one directory or drive to another
Prompt on screen: drive:>
Syntax: copy drive:\source path\filename
drive:\destination path\ filename
Example: copy c:\neduet\cfile.exe c:\windows
This will copy the file, named ‘cfile.exe’ from ‘neduet’ directory to
‘windows’ directory with the same name for the new file.
 rento rename a file
Prompt on screen: drive:>
Syntax: ren drive:\path\old filename drive:\path\new filename
Example: c:\>ren cfile.exe edit.exe
This will rename the file ‘cfile.exe’ to ‘edit.exe’ in the prompted drive C.
 del to delete a file
Prompt on screen: drive:>
Syntax: del drive:\path\filename
Example: c:\>del cfile.exe This will delete the file, ‘cfile.exe’ present in
theprompted drive C.
Wild cards can also be used with any of the above commands to work with group of files.

 typeto view a file on the screen. Only text based files can be viewed, as DOS supportsonly
such files.
Prompt on screen: drive:>
Syntax: type drive:\path\filename
Example: c:\>type cfile.txt This will list ‘cfile.txt’.
Files longer than one screen scroll off to the top. To avoid this,
use |more suffixfollowing the command.
Example: c:\>type cfile.txt |more

Department of Information & Communication Engineering 3


Introduction to Computing (COMP-01102) Telecom 1stSemester

Disk Management
 format to format a disk
Prompt on screen: drive:>
Syntax: format drive:
Example: c:\>format Z: This will format Flash memory stick in drive Z.

 chkdskto get a report on statistics of the disk


Prompt on screen: drive:>
Syntax: chkdsk drive:
Example: c:\>chkdsk c: This will generate a report on statistics of drive C.

 volto view a disk’s volume label and it’s serial number


Prompt on screen: drive:>
Syntax: vol drive:
Example: c:\>vol d: This will display volume label of drive d.

 verto find current version of DOS installed on your system


Prompt on screen: drive:>
Syntax: ver
Example: c:\>ver This will display the current version of DOS on your system.
Tip:
You can take help for any DOS command by typing command name followed by /?
e.g.

Home Tasks
1. Write command to display all files having extension ‘docx’.

Department of Information & Communication Engineering 4


Introduction to Computing (COMP-01102) Telecom 1stSemester

ANSWER: F:>dir itc*.docx

2. Write command to display all files of all types starting with letter ‘s’.

ANSWER: F:>dir itc*.‘s’

3. Write a command to copy the file assignment of type docx from the directory ‘ITC’ of
drive D to another directory “FCE” in drive F.

ANSWER: F:itc>*.docx E:\FBA

4. Write a command to delete the directory as well as the files of the directory ‘world’ on
drive E.

ANSWER: F:\del world then E:\rd world

5. Write command to copy all the files beginning with ‘m’ and whose file names has a‘txt’
extension from drive A to the ‘\document’ directory on drive C.Discuss different types
of CPUs.

ANSWER: F: itc>copy f*.txt E:\document

6. Write set of commands to create a directory ‘practical’ on drive F, and then move
intoit. Now list all files present in it, then go back to root drive F.

ANSWER: F:> fe practical

F:\ ed practical

F:\ practical > dir

F:\ practical > ed

F:\>

Department of Information & Communication Engineering 5

You might also like