Home Page 1
Index Next Page
DOS for Windows9x

DOS & the Command Prompt

Topics
DOS .. ?? What Is DOS? Prompt The Command Prompt
Dos Box The DOS Box Initiation An Initial Foray
Editing Editing Files How Do I .. .. Get Out Of Here?
Main Topic Index

What Is DOS?
DOS stands for Disk Operating System. It provides for PCs an 'environment' within which programs can run. It takes their commands and interprets them to the hardware, doling out system resources as needed and trying to prevent things going haywire. This is known as "Real Mode" (ie, talking directly to the guts of the machine).

Think of making a cup of coffee. Here you are the Operating System. You fill the kettle with water, plug it in, switch it on, get a cup, add coffee and so on, deciding as you go what happens when. You can't get inside a computer to bring its actions together, so DOS does it. When you type in a command ("Fill Kettle") it does so. You then have to tell it "Fetch Cup", "Find Spoon" ... but it gets there.

The items involved (kettle, water tap, cup, spoon) are Devices - like the keyboard, monitor, mouse, printer, speakers and whatever else you have on your PC. Most need a Driver. In coffee-making that's also you, telling your hands to go to work!   A Printer Driver gets an order from the program - "Print this document, 2 pages long, landscape format, 1-inch margins" - and tells the Printer what to do.   When you issue a keyboard command in a program, it sends out a message which DOS interprets to tell the Driver of the Device needed to perform the action to do it. At its most obvious level, if you type 'Dear Bill,' DOS tells the monitor to display that.

Most of the basic functions of DOS have been taken over by the Windows 95 & 98 (Win9x) Operating System. You just say "Cup of Coffee" and it will co-ordinate the kettle, water tap, cup, spoon etc and deliver a cup according to how hot and strong you have told it you like your coffee, simultaneously managing how the programs you are using are working.

Win9x doesn't normally use Real Mode (DOS) Device Drivers. It has its own Virtual Device Drivers to tell the hard disk, printer, soundcard etc what to do, and does so better and faster than DOS. But DOS Mode remains available to Win95 and Win98.

When things are running as they should, this is mostly to ensure backwards-compatibility with older programs which were not designed to run under Windows. When things are not looking too happy, however, DOS Mode is a vital means of sorting things out, though it cannot by itself correct a corrupted Registry or eliminate faults in the installation of hardware devices. Windows98 has better internal methods of troubleshooting than Windows95, obviating the need to work in DOS in some cases, but still needs DOS for some operations.  Windows ME/XP do not have the same Dos-mode access.

You should only need to issue DOS commands in times of stress. Everyone should prepare for an emergency by creating and testing a proper Boot Disk (see Re-installing Windows9x). Those who have never been to DOS are often frightened by its appearance and nerdish reputation. This is as unnecessary as being afraid of clicking on an item on the Windows Start menu. DOS is largely self-protective. If you tell it to do something dangerous it will ask if you really mean that. As with any message popping up in Windows with a question, you can spend the next few years pondering - it won't go anywhere until you decide the answer.

So you don't need to know very much about DOS. There is far more even in this cut-down Introduction than you will probably ever use, but I do suggest you peruse the various sections before plunging in.
Top of Page     Main Topic Index

The Command Prompt
The Command Prompt has three commonly-used names, all of which mean the same thing:
Command Prompt      DOS Prompt      C:\ Prompt

There are different ways to get to the Command Prompt, but let's begin with the simplest. This is also the safest if you are 'messing around in DOS', as Windows has not yet been loaded nor is it still lurking in the background.

Reboot the computer, hit F8 as soon as 'Starting Windows9x'; appears (under Win98 hold down the Ctrl key during bootup), and from the Boot Menu choose 'Command Prompt Only' (not 'Safe Mode Command Prompt', which bypasses all startup files - usually neither necessary nor desirable).

You will arrive at the C:\ Prompt ( C:\> ) which is the default on most systems. C:\> simply means you are in the root C:\ directory, and - with some exceptions - any command you type will look for the file to run in that directory. This is the point in DOS from which you type in commands, and the blinking cursor (    ) after the ' > ' is 'prompting' you to do so.

The Prompt varies. If you Shut Down Windows and choose the option 'Restart the computer in MS-DOS mode' the prompt will say   C:\WINDOWS>   meaning you are in the Windows directory on drive C:.   The same will happen if you go to DOS by choosing the 'MS-DOS Prompt' from the Windows Start Menu.   And if you use a Boot Disk (or Startup Floppy) the Prompt will be   A:\>   meaning you are in drive A:.

DOS uses the term 'Directory' and Windows 9x use 'Folder'. They are the same thing.
Top of Page     Main Topic Index

The DOS Box
This is the DOS Window you get if you choose the 'MS-DOS Prompt' from the Windows Start Menu. You can do a number of things from here, which saves closing Windows itself. But remember that Windows is still running and don't try to issue 'system' commands! You will will usually get a protest that you can't do that anyway.

If you install upgrades to programs, an 'upgrade.exe' (or whatever it is called) may well open a DOS Box itself to expand new files and delete old ones. This is harmless but you will need to close the Box yourself once activity has stopped. You cannot use such a Box to do anything as it is associated with the program which opened it.

You can run some commands in a DOS Box, including some contained in Batch files (see DIR, Xcopy & Batch Files). But be wary of doing anything with files which may currently be in use. Unless told to do something using a DOS Box, it is best avoided until sure you know what you're doing ...
Top of Page     Main Topic Index

An Initial Foray
Let's introduce you to DOS Mode with something simple, but fundamental to DOS.

System Startup commands are contained in two text files: C:\CONFIG.SYS, which most PCs run first on bootup, and C:\AUTOEXEC.BAT, which is automatically processed after Config.sys. (IO.sys and MSDOS.sys are irrelevant at this point). You can see some of the sequences these files initiate by hitting F8 on booting up as soon as you see 'Starting Windows 95' (be quick!). Under Win98, just hold the Ctrl key down while the boot process is running.
  1. You will get the Boot Menu. Select the Step-by-Step option.
  2. Answer  Y (Yes)  (ie press the Y key) to everything - except at three points.
  3. When it asks if you want a log (Bootlog.txt) answer  N (No)  (ie press the N key).
  4. After beginning to process Autoexec.bat it will probably ask @ECHO OFF? – answer  N (No)  (ie press the N key).
  5. Continue as the process completes. Not a lot to see, admittedly, but that is what you normally don't see - unless you have the 'Starting Windows9x' splash screen disabled - and probably don't want to see either!
  6. Answer   N (No)   (ie press the N key) to the final question:  Win? . Windows will not load and you will be left at the C:\ Prompt. That's where you start typing DOS commands. Just type the command and press Enter.
  7. Try it at the point where you halted the system at the prompt:
         Win    [Enter]   and Windows will carry on loading.
DOS is not case-sensitive, so you can type  Win, WiN, wIN, wIn, WIN, win or wiN   or any other Command like that and it won't object even if your fingers do. If you make an error, use the backspace key and start again - there is no mouse and no selection key-combinations in this environment!

Some Laptops and Brand-name machines may not have Config.sys and Autoexec.bat on their hard disks. Or they may have the files, but empty. Windows itself does not need them provided no DOS mode working is ever required. This is not a strategy many would recommend. Don't worry for the moment if you do not have them on your setup. You can create basic, working versions of the files for your own setup later if you wish by following this Introduction to DOS, and more particularly the Guide to Re-installing Windows9x.
Top of Page     Main Topic Index

Editing Files in DOS
The DOS Editor:
Both Config.sys and Autoexec.bat can easily be edited, along with *.ini files and a number of other text-only files which may have become corrupt or need tweaking.

At the DOS prompt just type the word Edit followed by the name of the file, then press Enter, thus:
     Edit Config.sys    [Enter]

Note: If you have opened a DOS Box or told the computer to 'Shut Down & Restart in MS-DOS Mode', the Command Prompt (ie the 'current directory') will probably be:   C:\Windows\>   You will need to Change Directory to get to the root directory   C:\>    so type   cd\    [Enter]   or type the full path:    Edit c:\config.sys    [Enter]

A simple DOS text editor will appear, in a basic 'Window' format with the usual drop-down Menu commands for saving, copying, pasting etc. If you have no mouse at this point, use Alt to activate the Menu, and navigate using the arrow and Tab keys. The colours of all parts of the DOS Editor can be changed via the Options menu; if you do so, be patient as the selection of foreground (text) and background colours is more clumsy than you will be used to, and requires tweaking to get something which won't either be invisible or give you an instant headache!

Play around with the file, selecting and moving text. The selection keys (Ctrl+Shift+Arrow) do work, but a bit sluggishly. It is no more difficult to use than Notepad once you are accustomed to it. When finished, simply Exit (Alt-F-X). You will be asked if you wish to save the file. Answer 'No' (press N), as this is just an initial practice.
Alternatives:
The DOS Editor is there for when you cannot use anything else, usually when the system won't load or you have had to boot from a floppy. When all is running OK and you need to amend existing files or create batch files, you can use Windows.

Sysedit:   One method of editing a few basic system files - Config.sys, Autoexec.bat, Win.ini, System.ini and some other Ini (initialisation settings) files - is built into Windows. From the Start Menu ask for Run, type in   sysedit   and press Enter. The grandly named System Configuration Editor will pop up, with these files in their own windows. Use the same editing techniques as in Notepad. When you save changes, the original file you have altered will also be saved with the   .syd   extension, so it can easily be restored.

Notepad:   Another alternative is Notepad itself. Open it, ask for File - Open, change the File Types from 'Text Documents' to 'All Files' and navigate normally to the file you want. Maximise the Notepad window, and don't engage "Word Wrap" as this can affect how text files are saved - it can scramble them!

Word Processors: Don't be tempted to think you can use a Word Processor instead of Notepad, which is specifically a Text Editor. They can be used, but only if you are sure you know how to 'Save as Text-only'. If normal WP formatting is applied, the files will be corrupted.
Top of Page     Main Topic Index

How Do I Get Out Of DOS?
  • Shutting Down
    If your machine is modern you may never have shut it down, leaving Windows to do it. Or yours may leave you with the 'It Is Safe To Turn Off' message. You may therefore feel hesitant about turning off while DOS is 'running'. Don't worry. As long as there is no disk activity and you're at a Command Prompt nothing is running, so just switch off your PC.
  • Getting To Windows
    If you asked for "Command Prompt" from the Boot Menu, type:
         Win    [Enter]   Windows will load. Or key:
         Ctrl+Alt+Del   And leave the computer to reboot normally.
  • Getting Back To Windows
    If you were in Windows and asked for Shutdown - Restart in Dos Mode, type:
         Exit    [Enter]   You'll see "Windows is Restarting". Or key:
         Ctrl+Alt+Del   And leave the computer to reboot normally.
  • Closing a DOS Box
    Treat a DOS Box as you would a Window. If you have finished and are at a Command Prompt, just close the Window by clicking on the 'X', top right. Or type:
         Exit    [Enter]   The Dos Window will close. (You cannot use the   Alt+F4   keyboard command).
Top of Page     Main Topic Index

Next Page

< Home >