Essential DOS Commands

Essential DOS Commands and Concepts


DOS (an acronym for Disk Operation System) is a tool which allows you to control the operation of the IBM PC. DOS is software which was written to control hardware. IDRISI, Atlas*GIS, Microstation, AutoCAD, CPS/PC, and ARC/INFO are, in turn, application software which run under DOS. By this we mean that, although IDRISI, Atlas*GIS, Microstation, AutoCAD, CPS/PC, and ARC/INFO were written to accomplish a single task or application (in this case manipulation of spatially related data), they must use DOS to pursue its work.

DOS can be used for a wide range of tasks far beyond the requirements of this class. You will be able to manage well if you master only a small subset of DOS commands and functions. These relate almost exclusively to file and directory management and are introduced in this handout.

This tip sheet assumes that you have learned how to turn on the PCs as they are configured in room 230 and that you have familiarized yourself with their keyboards (no small task in itself). It also assumes that you understand the meaning of the concept of a file and the elements of a file specification (drive, filename, and extension). The microcomputers you will be using are equipped with two floppy disk drives. The A-drive is the 3.5" (1.44MB) drive and the B-drive is the 5.25" (360KB) drive. The microcomputers also contain a C-drive, a hard disk drive of 130MB or 200MB capacity.

You will quickly find that the best way to learn how to use a computer is through experimentation. That is, once you have learned a command, try some variations until they don't work, then start over. Often there are five or six ways for you to accomplish a particular task. Usually, I will introduce you to only one, leaving it up to you to discover the rest. Don't hesitate to consult the DOS Reference Manual; copies can be found on the bookcase in room 230. Finally, don't be unduly disturbed by error messages. With computers, one of the best ways to learn is by making mistakes.

Most of the common DOS commands you need to use for this class (copy, rename, delete) are available to you in Windows through the Filemanager icon. And, since you can move back and forth between DOS and Windows, it doesn't matter which option you employ. Some commands are faster in invoke in Windows, some in DOS. If you haven't worked with Windows previously, go to the Windows tutorials in the help area.

Backup Files

It is possible to lose files by mistake, although the more you practice the less likely it becomes. For your own peace of mind, it is good practice to make backup copies of your most valuable files on a separate diskette. Store your backup disk in a safe place and don't carry it through a metal detector. Use the COPY command to create the backup.

There is no need to backup every file you create, only the ones in which you've invested much work. Also, prune your backup diskette every week or two using the ERASE command. Backup files which have been made redundant by subsequent additions will simply create clutter on your backup diskette. An effective file naming convention is essential to keeping track of your backups.

Change the Default Drive

To change the default drive, simply type the letter of the your choice. The new default will be listed in subsequent DOS prompts.


  • C> A: [enter]
  • Changes the default drive from C to A.
  • A> C: [enter]
  • Changes the default drive from A to C.
[enter] means that you must press the Enter Key before the format command will execute. [Enter] is required after any DOS command, it is assumed in all commands found below.

CHDIR (CD) Change Directory Command

Once you have located the directory you want, you may move from directory to directory using the CD command (change directory)


  • C> cd furniture
  • Moves you to the directory called 'FURNITURE'
  • C> cd \furniture\chairs
  • Moves you to the directory called 'CHAIRS' under the directory called 'FURNITURE'.
  • C> cd ..
  • Moves you up one level in the path.
  • C> cd \
  • Takes you back to the root directory (c: in this case).

COPY Command

The COPY command can be used both to copy files from disk to disk or to create a second copy of a file on a single disk. (There are many more uses of the COPY command, but only the basic operation is discussed here.)


  • C> copy c:kermit.exe a:
  • Copies the file 'KERMIT.EXE' from the C drive to the A drive and gives it the same name.
  • C> copy a:brazil1.dat b:\south\brazil2.dat
  • Creates a copy of 'BRAZIL1.DAT' from drive A on drive B, putting it in the 'SOUTH' subdirectory and renaming it 'BRAZIL2.DAT'.
The key to use this command correctly is to remember that the first file specified after the COPY command is the source file, the second is the target:ehp1 file. The source is the file to be copied. The target will be the location and name of the new file. If the file name and extension are omitted after the target's drive specification, the new file will have exactly the same name as the source file.


  • C> copy a:myfile.txt b:
  • C> copy
  • C> copy b:golly.gee a:whao.boy
  • C> copy command.* a:
  • C> copy a:mymap.dwg c:\maps
Note: it is always good practice to us the complete file specifications for both source and target files, Be very sure of yourself before you accept defaults or employ wild-card characters. Otherwise you may end up with some interesting results. Incomplete or incorrect source names may result in errors, such as the command: copy edlin a:myomy.bat. Try it and see what happens.

DIR (Directory) Command

The DIRECTORY command lists the names and sizes of all files located on a particular disk.


  • C> dir a:
  • Shows directory of drive A
  • C> dir b:
  • Shows directory of drive B
  • C> dir \agis
  • Shows files in a subdirectory on drive C (default)
  • C> dir
  • Shows directory of drive C
  • C> dir /w
  • Shows directory in wide format, as opposed to a vertical listing.
All the files are listed at the screen, you can stop the display by typing CTRL-BREAK. If you ask for a directory on the A or B drives, be sure there is a diskette in the drive and that the diskette has been formatted. If the drive is empty, or if the diskette is unformatted, the DOS will respond with an error message.

DIR Options

Two little characters, '*' and '?', will make your life with computers much easier. Their use is illustrated below.


  • C> dir a:*.ex
  • Lists all files on the A drive with an extension of 'EXE'.
  • C> dir b:kermit.*
  • Lists all files on the B drive with a filename of 'KERMIT'.
The asterisk is a wild-card character which allows the user to enter only a limited part of a file specification to find a file. It is useful when you wish to locate a group of files with the same filename or the same extension. On other occasions you may have forgotten part of a file specification. You can use '*' in place of the parts of the specification you have forgotten. Similarly, '?' permits wild-card searches keyed to single characters.


  • C> dir a:labe?.com
  • Lists all five-letter files with the first four letters 'LABE' and an extension of 'COM'.
  • C> dir b:format.c??
  • Lists all files with a filename of 'FORMAT' and an extension beginning with 'C'.
Wild-card characters can be used in combination.


  • C> dir a:labe?.*
  • Lists all five-letter files with the first four letters 'LABE' and any extension.
  • C> dir c:*.ex?
  • Lists all files with an extension beginning with 'EX'.
Experiment with '*' and '?' to improve your ability to find files quickly. These wild-card characters can also be used with several other DOS commands.

ERASE Command

The ERASE command deletes specified files.


  • C> erase a:myfile.txt
  • Erases the file MYFILE.TXT from the diskette in the A drive. If no drive specification is entered, the system looks to delete the specified file form drive C (in this case).
IMPORTANT WARNING: This command is easy to use, but it is the most dangerous one you will encounter in DOS (apart form FORMAT). If you aren't careful, you may delete a file which you--or someone else--needs. And, unless you have saved a backup of that file, the erased file is gone for good. For this reason it is good practice to use only complete file specifications with the ERASE command (and to keep backups of your most valuable files). As a safety precaution, never use the wild-card characters '*' and '?' in ERASE commands.

BEWARE: I will rescind your laboratory privileges for a full week if you ever knowingly use either the command: erase c:*.*, or the command: erase *.*. Guess what happens?

File-Naming Conventions

Careful file naming can save time. Always choose names which provide a clue to the file's contents. If you are working with a series of related files, use a number somewhere in the name to indicate which version you have created. This applies only to the filename parameter; most of the file extension parameters you will be using are predetermined (or reserved by DOS for certain types of file).


  • An ATLAS*GRAPHICS file containing data for a world map. The DAT extension is required by ATLAS*GRAPHICS.
  • A boundary file of Brazil in binary form.
  • Three versions of a data file for a map of Britain.

FORMAT Command

You must format new disks before using them on the IBM computers. The format command checks a diskette for flaws and creates a directory where all the names of the diskette's files will be stored.


  • C> format a:
  • Formats the diskette in the A drive.
  • C> format b:
After entering this command, follow the instructions on the screen. When the FORMAT operation is complete, the system will ask if you wish to FORMAT more diskettes. If you are working with only one diskette, answer N (No) and carry on with you work. If you wish to FORMAT several diskettes, answer Y (Yes) until you have finished formatting all your diskettes.

BEWARE: Executing the format command with a diskette which already contains files will result in the deletion of all the contents of the entire disk. It is best to execute the format command only on new diskettes. If you format an old diskette make sure it contains nothing you wish to save.

MKDIR (MD) Make Directory Command

This command creates a new directory.


  • C> mkdir mine
  • Creates a directory called 'MINE'

Rebooting the computer (Ctrl-Alt-Del)

In some cases, when all attempts to recover from a barrage of error messages fails, as a last resort you can reboot the computer. To do this, you press, all at once, the control, alternate and delete.

BEWARE: If you re-boot, you may loose some of your work--any data active in RAM which has not yet been saved to disk.

RENAME (REN) Command

The RENAME command permits users to change the name of a file without making a copy of it.


  • C> ren a:goofy.txt pluto.txt
  • Changes the name of 'GOOFY.TXT' on the A drive to 'PLUTO.TXT'.
This command is very simple to use, just remember two points: the file name and extension must be complete for the source file and no drive specification is given for the target. Renaming can only occur on a single disk drive (otherwise COPY must be used).

RMDIR (RD) Remove Directory Command

This command removes a directory. It is only possible to execute this command if the directory you wish to remove is empty.


  • C> rd mine
  • Removes directory called 'MINE'.

Stop Execution (Ctrl-Break)

If you wish to stop the computer in the midst of executing the current command, you may use the key sequence Ctrl-Break. Ctrl-Break does not always work with non-DOS commands. Some software packages block its action in certain situations, but it is worth trying before you re-boot.

Converted 20 July 1994. KEF.
Re-Initialize Your Registry Without Rebooting

Press CTRL + ALT + DELETE, to bring up the Windows task list. Highlight 'Explorer' and click on 'End Task', if the Shutdown screen is shown, click 'Cancel'. After a few seconds an error message will popup, click on 'End Task' and the Windows explorer will be reloaded along with any new registry settings.

Shortcut to System Properties

To access the System Properties screen quickly, simply hold down the ALT key while double clicking on the My Computer icon.
While holding the windows key, press the Pause / Break key.
This will open up the System Properties box.
From here you can easily get to the Device Manager

Minimizing All Windows

Press Ctrl-ESC to bring up the Task Bar
Press Alt-M
With the Microsoft Keyboard, you can accomplish the same thing by pressing the Window-M key


Press CTRL + Z to undo things like renaming a file in Explorer

MS-Natural Keyboard Shortcuts

Toggles between minimizing/restoring all windows
Submitted by Vinamra Chandra Win+D
Open the start menu - Submitted by Daniel F. Win
Display the pop-up menu for the selected object - Submitted by Daniel F. Win+F1
Start Explorer Win+E
Find Files or Folders Win+F
Find computer Ctrl+Win+F
Minimizes all windows Win+M
Undo Minimize All Shift+Win+M
Display Run Dialog box Win-R
Cycles through taskbar buttons Win+Tab
Displays System Properties Win+Break

Fast Access to the Desktop

To get an Explorer view of the Desktop
Press Ctrl-Esc or click the Start button
Press R to go to Run. Note: If you are using a Win keyboard, you can get to this point by pressing Win+R
Type in a period

Duplicating the Right Mouse Click

Pressing the Shift-F10 key will be the same as clicking the right-mouse button.

Quickly Starting Explorer

You can quickly start an explorer session by holding down the Windows key on a Microsoft Keyboard and pressing the E.key

Internet Explorer Shortcuts

Go ‘Back’ to the previous page Alt+Left Arrow
Go ‘Forward’ to the next page Alt+Right Arrow
Add to Favorites on the current web page Ctrl+D
Open the History folder Ctrl+H
Open the Organize Favorites window Ctrl+B
Lets you open a new web page Ctrl+L
Open a new browser window Ctrl+N
Reload the current page Ctrl+R
Close the active Internet Explorer window Ctrl+W

Bringing up the Properties Window

While holding the ALT key double click on an icon to bring up the properties

Resizing and Moving a Window

Press Alt-Space
Press the S key - To Resize
Press the M key - To Move

Key stroking is faster than mouse moving

In desktop you can press "m", "My Briefcase is highlighted, press "enter" will open this applet.
If you do not press "enter",
The next "m" key stroke will highlight "My Computer".
"Ctrl"-"Esc", press "P" for Programs, "enter","M""enter", you get to the first program or folder that starts with "M"
Other applets will also be opened the same way.

Explorer Shortcut Keys

F4 - Displays the Combo Box
F5 - Refresh the display
Ctrl+Z - Undo last action
Backspace - Go up one directory

Moving Backward or Forward with the Wheel Mouse

You can rapidly go Backward or Forward in your IE Browser by holding down the Shift key while moving the mouse wheel.
This saves moving your mouse up and clicking on the Back or Forward buttons.

Most folks already know the keyboard shortcuts by holding down the Alt key and hitting the left and right cursor keys to effect the same thing.

Automatic Entry of WWW and COM

Internet Explorer can automatically fill in the www and com part of a url. Just type in middle part and CTRL+Enter

Starting Internet Explorer in Full Screen Kiosk Mode

You can create a shortcut that will start the Internet Explorer in Kiosk mode.
There are no menu's and all commands need to be entered though keystrokes (eg Ctrl-O to open)

Right click on an open area of the desktop
Select New / Shortcut
For the Command enter "C:\Program Files\Internet Explorer\IEXPLORE.EXE" -k
Give it any name you want

Easy Way to Scroll Through Web Pages

An easy way to scroll through web pages is with the spacebar.
The spacebar will scroll down a page
Shift-spacebar will scroll up a page

Internet Explorer Repair (IE5)

With IE5 there is a way to do a repair in case the installation has gotten corrupted.

Go to the Control Panel
Open up Add/Remove Programs
Select Microsoft Internet Explorer 5 and Internet Tools
Click the Add/Remove button
Check Repair Internet Explorer
Click on the OK button

Quick Way to Change the Security Settings (IE5)

To changing the Security Settings in IE5, simply double-click on the bottom right corner of the status bar.
Your security settings pop-up.

Adding a History Icon to your Desktop (IE5)

Right-click on an open area of the desktop

Select New / Folder.
Type the name, as shown: History.{FF393560-C2A7-11CF-BFF4-444553540000}
The icon will be replaced by the History icon.

Change Font Size

In IE4, hold down CTRL and use the mouse wheel to increase/decrease font size quickly.

Alt+Left Arrow - Goes ‘Back’ to the previous page
Alt+Right Arrow - Goes ‘Forward’ to the next page
Ctrl+D Does immediate ‘Add to Favorites’ on the current web page
Ctrl+H - Opens the History folder
Ctrl+B - Opens the Organize Favorites window
Ctrl+L - Lets you open a new web page
Ctrl+N - Opens a new browser window
Ctrl+R - Reloads the current page
Ctrl+W - Closes the active Internet Explorer window

Making Registry edits take effect

You'll notice that to make the above Registry edit take effect you had to close the Registry and reboot the computer. This is necessary to make many Registry tweaks work, because it's during the startup that Windows checks the Registry file to get much of the updated information.

Some Registry tweaks, however, take effect as soon as you close the Registry Editor. Others require only a refreshing of the Desktop just hit the F5 function key on your keyboard while the Desktop is active and Windows will update some of its system information.

Secret desktop folder from your Start menu    Windows

We've told you before how to access the secret folder of desktop icons. But now you can set up your system so this folder is available from your Start menu.

Right-click the Start button and select Open.

In the Start Menu folder, right-click on a blank space and select New and Shortcut.

For the Command Line, enter c:\windows\desktop and click Next.

Accept the default name Desktop or enter a new one, and click Finish.

Close Explorer and now you have a Desktop command on your Start menu.

Vertical integration                                            Word
Ever want to select a vertical block of text — like a column of figures — but Word only lets you highlight lines that go right right across the page? The trick is to hold down the Alt key (on a Macintosh, use the Option key) while you drag the mouse diagonally across the selection.

You can also do it with key commands alone. Press Ctrl, Shift and F8 together (with a Mac, use the Command key with Shift and F8), then let go and use the arrow keys to extend the highlighted box.

Secret desktop folder                                      Windows

Remember our tip for displaying a folder of all your desktop files and folders — click on Start and Run, enter a period and click OK? If you do this a lot, we can make it easier for you by setting up a button on the taskbar at the bottom of your screen that you can click when you want to see the desktop folder. Here's how to set this up:

Right-click Start and select Open from the context menu. This should open the Start Menu folder.

In the Start Menu folder, double-click Programs to open that folder, and then StartUp.

In the StartUp folder, right-click on a blank area and select New and Shortcut from the menus.

In the space for the Command Line, type c:\windows\explorer.exe c:\windows\desktop — there's a space only before the second c: and those are backward slashes. Click Next. (This command assumes Windows is stored in the directory named Windows. If not, substitute the name of your Windows folder for windows in both instances.)

Name the file something profound like Desktop and click Finish.

Back in the StartUp window, right-click the new Desktop icon and select Properties.

Under the Shortcut tab, in the Run field select Minimized and click Close.

The next time you start Windows, the Desktop icon will be on the taskbar. Click it at any time and you'll get immediate access to all your desktop items in a separate folder.

The quickest reboot yet

When we first published the previous trick, we got hordes of calls asking if the trick could be adapted to restarting, instead of shutting down, the computer.

The short answer is, "No." The long answer is that there’s a different kind of Cheap Trick to pull that off.

First you have to create what’s called a batch file. Open the text editor Notepad and type @exit and save the file on your hard drive as an All Files type with the title Restart.bat or something else with the .bat extension.

Find the file on your system with Windows’ Explorer, right-click on it and select Properties, Program, and Advanced. Check the MS-DOS Mode and Use Current MS-DOS Configuration boxes, leaving all other boxes unchecked. Click on OK twice to close the dilaogue box.

Make a shortcut to the file on your Desktop for easy accessibility.

Now whenever you want to quickly reboot Windows, just double-click on the Restart.bat shortcut icon. You save having to go through the whole Start/ShutDown/Restart/OK routine — and the reboot will ignore any floppy disks you have in the drives.

Turn a PC into a Macintosh
This nasty but harmless prank could be seen as a Machead's revenge on a Windows user — but it's a fun trick for PC users to pull on their friends too.

Tell a friend you've got a great Web site to show them on their Windows computer. Then direct them to with their browser. Before they can stop it, the computer will start scrolling up messages indicating their Windows system is being replaced by the Macintosh operating system. It'll even appear to boot up like a Mac and give them a screenwide desktop identical to the Mac's.

If your (former) friend frantically clicks on the various Mac-style desktop icons they'll find a memory game to play and will eventually discover in the trash how to restore the appearance of the screen to the usual Windows design. No harm done, it was all an Internet illusion.

(Kids, want to freak out your teachers? Try this trick on all the PCs in your school's computer lab!)

Scheduled shutdown

Suppose you want your computer to run a job but you can’t stick around until it’s done in order to turn it off afterwards. You can use this trick to have it shut down, say, an hour or two later.

In Windows 98 or Millennium Edition, click on the Start button, Programs, Accessories, System Tools and Scheduled Tasks. Double-click on Add Scheduled Task and then click on Next. Browse in the Windows directory until you find the file RUNDLL.EXE and select it.

In the next window, pick "One time only" and click on Next. Choose the time you want to shut down and click Next and then Finish.

But this won’t work yet.

Double-click on the task you’ve created and, in the window that appears, change RUNDLL.EXE to c:\Windows\RUNDLL.EXE user.exe,exitWindows (there’s only one space in the command – before user – and those are backslashes around the first Windows). Click on OK and now your computer is ready to shut down on schedule.

Some users may find that this trick works better if they use RUNDLL32.EXE in the command instead of RUNDLL.EXE or if they type \system\user,exitWindows instead of user.exe,exitWindows.

Where’d my drives go?

Here’s a nasty but harmless trick to play on a friend — make their drives disappear from the My Computer folder! Or do it to your own system, if you simply want to get rid of some icons.

In the Registry, work your way to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. In the right pane, right-click and select New and DWORD value. When the value appears in the right pane, rename it NoDrives and double click on it to open its Edit DWORD Value window. Enter 3FFFFFF in the space provided and make sure Hexidecimal is selected. Click OK.

The next time the computer is restarted, My Computer will have no drive icons in it.

After your friend has torn out her hair, you can confess your prank and go back to the Registry to delete the NoDrives value. Reboot and everything will be back to normal.

But we wouldn’t let your friend get her hands on your computer for a while.

State of your connection

You can discover just what servers you're connected to while on the World Wide Web by invoking the “netstat” command.

While connected to the Internet, click on the Start button and Run. In the space provided type netstat and click OK. Up will pop a list in an MS-DOS window that shows the servers you are connected to and the state of the connection.                                                      

DOS/98                                             README.TXT                         




Customizing and Tweaking Tools

The DNS lookup process can often slow you down. With FastDNS, you can add all of your favorite Websites, e-mail/chat servers, and anything else with a host name address for faster connections.      ,0/cyberlat%20ram%20cleaner%201,0.exe