Windows 7 / Getting Started

Console Program Input and Output

Unlike Windows programs that display a window panel with menus and buttons, most programs designed to be run from a command prompt simply type out information line-by-line into the Command Prompt window. These programs are called console programs because they interact through plain-text input and output like old-fashioned programs that ran on a computer's main terminal; back then, the main terminal was often called a console.

The tasklist command is a good example of a console program. If you type tasklist in the Command Prompt window and press Enter, this program displays a list of all programs and services that are currently running on your computer.

Each Command Prompt window has the concept of a current directory, its default folder, which is its starting place when looking for files. Although Windows Explorer displays its current directory in its status and address bars, it's most common for the Command Prompt window to show the current directory name in its prompt, the indicator it prints to tell you it's ready to accept another command.


Whereas you use dialog boxes and menus to tell Windows programs how to modify their behavior, you have to type this information into console programs. The tasklist command is another good example of this. If you want to see the tasks and programs running on the computer named bali, which is connected to my network, following command:

tasklist /s bali /u Administrator

In this command, /s tells tasklist that I want to query the networked computer named bali, and /u indicates that want to use the Administrator logon to get this information. /s and /u are called switches or options. Most console programs display the list of options they accept if you enter /? on their command lines.

Those are the basics. Now, let's look at some of CMD's more involved features.

[Previous] [Contents] [Next]