Lesson 2 - The DOS Operating System

I think that people,  who were forced to find their way around computers running the MS-DOS operating system,  are at an advantage because they know what files are and where they live.   Operating environments such as Windows and the MAC try to cover up these details,  making it harder to learn what really is going on.

Picture yourself sitting at a computer with just the DOS prompt on the screen.   The DOS prompt usually looks like this C:> .   Did you know that there is a program running?   Well,  yes there is,  it's the disk operating system,  DOS.   It's busy doing what it does best,  which is waiting for you to tell it what to do.

So you slide up to your trusty input device,  the keyboard,  and you type a word,  say dor and then you press Enter.   Before talking about what happens next,  let's look at what just happened.

Each time you pressed a letter,  it actually did go to the computer,  because it appeared on the output device,  the monitor.   If you follow the wires,  you see that the only way to get to the monitor from the keyboard is through the computer!  

So,  we learned something,  DOS really is running because somehow the action of pressing a certain key on the keyboard input device,  resulted in a letter being printed in the proper location on the screen output device!   That is actually quite a feat,  and computers had been around a long time before a program could do that.   The fact that DOS puts the character whose key was just pressed on the screen is called echoing and it's done only as a convenience to you,  the user.   And they say that DOS is not user friendly!

DOS also knows enough not to try to interpret what you have typed until you press the Enter key,  indicating you are finished.   There is nothing magical about the Enter key,  it is just another key,  but one that the DOS program,  and many other programs,  have been programmed to recognize as "OK,  I'm finished inputting,  you figure out what I input.".

Okay,  so now DOS has three letters in a row,  in computer terms called a string. The DOS program has a list of steps to follow when it receives a string from the keyboard.

 

Check to see if it is a command you recognize.   If yes,  then do it.  

 

If not,  then check to see if there is a file in the current directory that ends in .com or .exe or .bat but has the same first part,  such as dor.com or dor.exe or dor.bat.   If there is,  then get a copy of that file from the long term storage device and put it into the short term storage,  the RAM,  and run the program.

 

If there is no such file in the current dir,  then look in each directory that is listed in a list of directories called the Path.   If you can find such a file,  then,  again,  pull it into RAM and run it (called executing the file).

 

If DOS has taken all of these steps and still can't interpret what you want,  then,  using the monitor output device,  tell the user 'Bad command or file name'.

Just be thankful that the computer wasn't given boots as an output device,  because a kick in the shins would be more appropriate,  after sending the poor thing on such a wild goose chase!

So,  one thing we've learned is that dor is a pretty meaningless word to both DOS and us!   Now try typing dir

Hey,  that's better.   dir is a command that DOS knows,  and it means "list all the files and directories that are in the current directory."

Now,  when you see 'Bad command or file name' after telling DOS to do something,  you don't have to just sit there with this confused look on your face.   On the logical side of your brain you can figure out why you got that ouptut instead of the one you were expecting.   If you had typed the name of a program,  say wp and were expecting to start-up Word Perfect,  but received that friendly 'Bad command or file name' instead.  then you can go over in your head exactly what DOS had tried to do.

First,  it checked to see if wp was a command it recognized - no it wasn't.   Then it looked for wp.com or wp.exe or wp.bat in its current directory,  the directory the operating system was left in.   If it was there,  DOS would have grabbed the file off the hard drive and put a copy in the RAM.   But it wasn't there.   Then DOS looked in all the directories that are listed in its path variable.   You can see what directories it looks in by giving DOS the command path.   [ Giving DOS the command path means typing path at the dos prompt C:> and pressing Enter ].   DOS spits out the list of directories it has been told to look in.   It didn't find such a file there,  so it told you so.

Let us learn few important DOS commands:

Commands: Functionalities:
CLS Cls is a command which allows the user to clear the complete contents of the screen and leave only a prompt.
COMMAND The command.com is the command interpreter for MS-DOS and is required for the majority of Microsoft's Operating Systems. Without command.com the computer running a Microsoft Operating System would be unable to boot.
COPY Allows the user to copy one file from one source to another.
DIR The dir command allows you to see the available files in the current and or parent directories.
DOSKEY (Useful) Doskey is a MS-DOS utility which allows a user to keep a history of commands used on the computer. Allowing frequently used commands to be used without having to type the commands in each time you would like to use them.
EXIT The exit command is used to withdrawal from the currently running application.
HELP Help is used to access the information and help file from a MS-DOS prompt.

MS-DOS 5.x uses help.exe.
MS-DOS 6.x uses help.com.

 

MD Allows you to create your own directories in DOS.
CD CD (Change Directory) is a command used to switch directories in MS-DOS. For example if you needed to run Windows 3.11 from DOS you would type:

cd windows - Changing the directory to Windows.
win - To run the win.com file within the windows directory.

 

How to goto DOS Prompt

If you are using WINDOWS 95 or higher, go through the following steps:

1. Click the Start Button on the lower left hand corner of the screen.
2. Choose the Accessories Menu.
3. Then choose Command Prompt and click it.

You will see a screen like the following:


  Running a command:

Running a command in the command prompt is very simple. Just enter the command name and hit the enter key. In this case, the command is "DIR". You will be displayed with a list of files and directories of the current directory/folder:

 

Note: Depending upon the feedback, I am planning to include more lessons to help our KIDS.

Good Luck.

                                                       

Home  Lesson 1





1