Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Class notes Computer programming

Rating
-
Sold
-
Pages
10
Uploaded on
24-02-2024
Written in
2023/2024

Class notes Computer programming

Institution
Course

Content preview

MS-DOS Command Examples




Logging on to a Drive
When you type in MS-DOS commands, your drive letter is shown on the command line. You can log
on the A: drive (have the A: drive as your prompt) or on to any valid drive by just typing in the drive
letter followed by a colon and then pressing Enter. When you log on to a drive, all your commands will
be executed on that drive - unless you specify otherwise.

Here are the steps:

1. Put a floppy disk into your machine.
2. Open an MS-DOS window. You will be at the C:\> prompt (you may be inside a
directory structure, but you will be on the C: drive)
3. At the prompt, type in A: and press Enter.
4. Do a DIR to prove you are now on a blank drive (a drive with no files on it).


Making A Directory (using MKDIR or MD)
The way you make directories on a disk drive is to use the MKDIR command. The MKDIR command
has a shortened form called MD and you can use either command interchangeably. For our examples,
we will use MKDIR since that command is standard in at least one other operating system (Unix).

For this exercise, we will make a directory called FREEDOM on our floppy diskette. Which we will
use in follow-on exercises. To make the directory, do the following:

1. Put your floppy disk into the computer.
2. Go to MS-DOS and log into the A: drive.
3. Using the MKDIR command, make a directory called FREEDOM. The syntax will be:

MKDIR FREEDOM

(be sure you are on the A: drive when you use the command!)

, Changing Directories (using CHDIR or CD)
Directories are containers that are made to hold your files in a nice orderly way. To get to those
directories and to see the files in them, you would use a combination of the CHDIR (or CD) commands
and the DIR command. Do the following exercise to see how the CHDIR (or CD) command is used.

1. Put your floppy disk in the drive (be sure you have completed the previous MKDIR task)
2. Go to the MS-DOS prompt and log on to the A: drive.
3. Use the CHDIR command to enter the FREEDOM directory that you made previously.
(CD FREEDOM)
4. Use the DIR command to see that there are no files in the directory. (only the . and .. files
and those are for MS-DOS internal use).
5. Using the EDIT command, make two files. Call the first one AAA.TXT and the second
one B.TXT.
6. Exit the EDIT program and do a DIR of the directory so you can see the files you just
made.
7. Use the CHDIR command to get back to the root of the A: drive. ('CD \' is the
command!)



Important Shortcuts To Remember:

To change to the ROOT directory from any directory or subdirectory type:

CHDIR \ {ENTER}

To change to the parent directory of your current directory type:

CHDIR .. {ENTER}




Adding Parameters to a command
A parameter is a letter typed after a command, that tells the command to carry out an extra task. These
parameters are also called 'switches'.

For instance, a command that you've already used is the DIR command. The command with a parameter
might look like this:

DIR /S /P

( The /S and the /P are the parameters. You can use either one.)

Written for

Institution
Secondary school
Course
School year
2

Document information

Uploaded on
February 24, 2024
Number of pages
10
Written in
2023/2024
Type
Class notes
Professor(s)
Msdos
Contains
All classes

Subjects

$10.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
rahulsrivastava

Get to know the seller

Seller avatar
rahulsrivastava (self)
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions