Introduction to DOS

Learn more at

Today, we all interface with the Windows Operating System through it's graphical user interface (GUI). It's easy to perform tasks and configure the system using with check boxes and drop-down lists. However, the first PCs didn't use the Windows Operating System, they used the Disk Operating System (DOS). DOS has a text interface where the user performs tasks and configures the system by typing text commands. The interface is referred to as the command line.

The DOS command line interface is still available in Windows Vista, and no matter how crude you might think it is, the DOS command line interface is still used regularly by the most skilled system administrators. Below is a list of the advantages that the DOS interface has over the GUI interface for configuring the system and performing administrative tasks.

Much like a department store that re-arranges the old merchandise to make you think they have something new, with every new Windows version Microsoft shuffles menu items around and shuffles functions between dialog boxes. But the DOS commands to perform administrative tasks rarely change.

Typing a DOS command is much quicker than navigating menus, opening dialog boxes, setting check boxes, scrolling through drop-down lists, and clicking on buttons.

GUI utilities are not available for the most powerful system commands. That's because only the most skilled system administrators know how to use the command line interface, and Microsoft would rather not have rookies playing with the most powerful system commands.

You can type many DOS commands into a file called a batch file. A batch file is a script is executed by typing the name of the file at the command line. With a DOS command batch file, you can automate administrative tasks that would require multiple GUI utilities to perform. When you need to perform the same task again, just type the name of the batch file at the command line again.

Many Network administrative tasks have no GUI utility interface.

When the GUI can't load, the DOS command line interface is the only way you can troubleshoot and repair the system.

Running DOS Commands

To run DOS commands in the GUI interface (and not in batch file), you first need to open a command window. A command window is a window that displays the DOS prompt. The DOS prompt is the location in the command window where you type command text. To open a command window select Start | All Programs | Accessories and click on Command Prompt. Shown below is an example of the DOS Prompt that you'll see in the command window that appears.

c:\Users\User Name>_

dir is a very common DOS command. The dir command returns a list of all the folders and files in the path listed in the DOS Prompt. Type dir at the blinking insertion cursor and press the keyboard [Enter] key. A list of all the folders and files in the path listed should appear in the command window. The proper way to close a command window is to type exit at the DOS Prompt.

Another way to open a command window is to select Start | Run... and in the Run dialog box that appears, type cmd and then click on the [OK] button.

For quick access the the command window, you can place a shortcut on your Windows desk top. Right-click on a open area of your desk top and, in the popup menu that appears, select New > Shortcut. In the Create Shortcut dialog box that appears, click on the [Browse...] button and navigate to c:\windows\system32 and click on cmd.exe to highlight it. Then click on the [OK] button. In the Create Shortcut dialog box click on the [Next] button to continue. Then type in a name for the shortcut e.g. Command Prompt and click on the [Finish] button.

Notice that when you double-click on the shortcut, the DOS prompt in the command window that appears displays the path c:\windows\system32. This path is called the current directory and any DOS commands that you enter will apply to the current directory. Change the directory to your desktop folder by typing cd c:\users\user name\desktop (replacing user name with your user name). When the prompt returns with the path to your desktop, type the following command.

dir > dir.txt

When the prompt returns type type exit to close the command window. Then look on your desktop for a file named dir.txt. Open this file in Windows Notepad or any text editor to view a list of the folders and files on your desktop.

The command dir > dir.txt tells DOS to create a list of the folders that are in the current directory and redirect that output from the default output (the command window) to the file dir.txt (if the file doesn't exist, created it). You can now print this directory listing if you desire.

There are many more commands available with the DOS command line interface, most of them feature switches, and wild cards which make them very powerful. In future articles you'll learn how to use switches, and wild cards and more about how to navigate the file structure with DOS.

Learn more at

More Windows Administration Information:
• Synchronize Your PC's Clock with an Internet Time Server
• Installing a Network Printer on Windows XP and Vista
• Kill The Messenger (Service)
• Hard Disk Management
• Application, Program, Process, Service, Thread; What Does it All Mean?
• Defend Your Business with a Firewall
• Use PowerShell and WMI to Get CPU Information
• Configure Windows 10 to Search Windows Only
• How to Transfer a Large Amount of Data Between Two Windows 10 Computers
• Environment variables in PowerShell