Dos Command Prompt – Tutorial
This tutorial covers the basic commands that you may find helpful for using the dos command prompt,
as well as instructions on compiling java programs in it.
To open the command prompt, hold the windows key (see below) and press R, then type in cmd in the
Run dialog window, then press OK.
You should see something like this (without the yellow line):
C:\Documents and Settings\Alvin means that we are currently in the folder named Alvin, which is in the
folder Documents and Settings, which is on the C drive/partition. This is also known as the path of the
Alvin folder. File system navigation (folder navigation) in command prompt is the same concept as
windows explorer, but instead of double clicking, we type in the name of the folder as commands.
Common to both, it is only when we are in that folder, that we are able to manipulate it (more so in
windows explorer than in Dos).
The key keyword dir stands for directory, and it shows all the files and directories contained in the
current folder. The contained files and directories are displayed as a vertical list, with dates & time of
which it was last modified.
This is the same as viewing the files in the ever‐familiar windows explorer that you’ve grown so
accustomed to. Just that in the command prompt, there are no graphical display, everything is in text
form. Note that in the windows explorer, the Address bar contains the identical address as the
command prompt (C:\Documents and Settings\Alvin)
Say that in windows explorer, we wish to go into the test folder, contained in the Alvin folder, we would
simply double click on the test folder’s icon. In the command prompt, to change to a contained folder,
we use the cd command, followed by the name of that folder. The cd command stands for “change
directory”. The output should look like the following. Though the explorer will show all the content of
the test folder, the command prompt simply switch it to that folder without automatically