0% found this document useful (0 votes)
149 views

MS DOS Commands: C:/WINDOWS/system32

This document provides an overview of common MS-DOS commands. It describes how to open the command prompt, view and set the current drive, view directory listings and file contents, manage files and folders by copying, deleting, renaming them, create new folders, view and set the date and time, and more. The document also explains important concepts like the root directory, current directory, wild cards, and provides examples of using commands like DIR, TYPE, CD, MD, COPY, DEL, REN, and EXIT.
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
0% found this document useful (0 votes)
149 views

MS DOS Commands: C:/WINDOWS/system32

This document provides an overview of common MS-DOS commands. It describes how to open the command prompt, view and set the current drive, view directory listings and file contents, manage files and folders by copying, deleting, renaming them, create new folders, view and set the date and time, and more. The document also explains important concepts like the root directory, current directory, wild cards, and provides examples of using commands like DIR, TYPE, CD, MD, COPY, DEL, REN, and EXIT.
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/ 3

CoSc-2042: Operating System MS DOS Lab Manual

MS DOS Commands

Introduction
MS DOS stands for Microsoft Disk Operating System. To open DOS command prompt select
Start|Programs||Accessories|Command Prompt
Or simply type command in the search box and press enter key
The Command Prompt you see on the screen might look like this:
C:\WINDOWS\system32>

Each disc drive attached to a computer system is identified by a name. In MS-DOS, the name
is a single letter followed by a colon. e.g. A:, C:. Traditionally, A: is a floppy drive while C:
is a hard disc drive. They are also described as Drive A and Drive C. The system prompt
C:\WINDOWS\system32> identifies the default drive as drive C. Unless a command
specifies otherwise, it is the default drive which is used by MS-DOS whenever a request to
use a file is received. As is usual in computing, there is alternative name for the default drive.
It is also known as the current drive.

To go to the root directory we use command cd\:


C:\WINDOWS\system32> cd\
The new screen will look like
C:\>

To change the default drive to drive D:, we type:


C:\> D:

The system prompt now changes to D:\>

VOL Command
The disc can be given a volume identification label (or volume for short) when the disc is
formatted. To see the volume of a disc type on the command prompt:
D:\>VOL

LABEL Command
This command is used to give name to the drive. This command prompts you for a name.
D:\>LABEL

Clearing the Screen


CLS command is used to clear the screen:
D:\>CLS

Setting the date and time


If you need to check the date and time you can use two commands: DATE and TIME.
D:\>DATE

Using the command DATE results in output like


Current date is: 23/09/2009
Enter new date (dd-mm-yy):

By Dr.Manish Kumar Mishra Page 1- 1


CoSc-2042: Operating System MS DOS Lab Manual

Pressing <Enter> leaves the computer's version of the date as it is whilst typing 05-04-17
would reset the date to 5th April 2017.
Similarly the command TIME allows you to check and reset the time.
D:\>TIME

The directory
The command DIR will make a listing on the screen of the files on your disc.
D:\>DIR
The following command will display all files with txt extension
D:\>DIR *.txt
* is called a wild card character
Viewing the contents of a large directory
DIR /P causes the output to pause at the end of each screenful. The display will resume when
you press any key.
DIR /W causes the file names to be displayed. Directory names are shown surrounded by [ ]
brackets.
DIR C: causes the directory in drive C to be listed even though the default drive may be
drive A.

The TYPE command


Files containing text can be directly displayed on the screen using the TYPE command.
This command must be followed by the name of the file you want displayed. Not all file
names have an extension. However, if a file name includes an extension, it must be included
when using the TYPE command.
D:\> TYPE STUDENTS.TXT

Changing the current directory


As you can imagine, several layers of directories will lead to very long full names for files.
An alternative strategy is to change the current directory. To make EXERCISE the current
directory we use the command CD or CHDIR:
D:/>CD EXERCISE

CD stands for Change Directory


Notice that the prompt has changed to:
D:\EXERCISE>
The prompt is telling us the current directory along with the current drive.
Now that we are in the EXERCISE directory we can see the directory contents by just using
the command DIR.

Making a new directory


The command MD (standing for Make Directory) or MKDIR is used to make a new
directory. Thus the command:
D:\>MD UOG
will create a subdirectory UOG

Copying files
Copying files is usually a simple matter of creating a duplicate of a file in another directory.
You cannot create a duplicate in the same directory without renaming the file - otherwise the
operating system would not be able to distinguish between them. Sometimes copying files to

By Dr.Manish Kumar Mishra Page 1- 2


CoSc-2042: Operating System MS DOS Lab Manual

another location on your disc makes sense. Perhaps you want to place a copy of a file in an
UOG directory while continuing to work on it in the current directory.
D:\>COPY HELLO.TXT HELLO1.TXT

Deleting files
Files can be removed from a directory by using the DEL command:
D:\>DEL hello1.txt
removes hello1.txt from the current directory

To remove all the files in the current directory we use


D:\>DEL *.*
Since removing all the files in a directory is a drastic action, MS-DOS asks you if you are
sure you want to go ahead.

Removing directories
RD command is used to remove a directory. We can only remove directories which contain
no files. Thus to remove ARCHIVE might use this sequence of commands:
D:\>CD ARCHIVE
D:\>DEL *.*
D:\>CD .. (This command moves us up to the parent directory)
D:\>RD ARCHIVE

Renaming a File
We use the RENAME command (REN for short) to change the name of a file. The general
format is:
D:\>REN {oldname} {newname} {ENTER}
e.g.
D:\> REN hello.txt hi.txt
Will rename file hello.txt to hi.txt
This will not work if a file with the new name already exists in the current directory.

Exit the Command Prompt


We use the EXIT command to close the command prompt:
D:\>EXIT

By Dr.Manish Kumar Mishra Page 1- 3

You might also like