Cmd.EXE

CMD.exe

The Help command

In Windows Command Prompt, type Help, followed by the enter key. What you’ll see fly by is a list of nearly 100 different commands provided by Windows that can be used in the Command Prompt.

Some are actual stand-alone programs. For example, the second item on the list is something called “ATTRIB”. That corresponds to the program file C:\Windows\system32\attrib.exe. (Command Prompt commands are case insensitive.)

Some are what are called “built in” commands – you won’t find them anywhere on the machine. An example is the first on the list: “ASSOC”. This command is actually implemented within the Command Prompt itself.

You can get help on individual commands by following “Help” with the name of the command. You can even type “Help Help”.

The More command

The list output generated by Help is likely much longer than your Command Prompt window, so much of the output was lost as it scrolled past the top. This is a very common problem in command line programs, and there’s a very simple solution: the “More” program.

More simply takes its input and displays it one screen at a time, pausing for a key press after each. This way you can read the contents of one screen and then press a key (I recommend the space bar) to see the next, and so on.

You can exit the program early by pressing the Q key (or Ctrl-Break, in earlier versions of Windows).

The question, then, is how to get the output of the Help command to be the input for the More command.

Piping

Piping is exactly that concept: taking the output of one program and providing it as the input to another. For example, in Command Prompt, type:

Help | More

Where “|” is the vertical bar character, often referred to as the “pipe” character. This instructs the first program to “pipe” its output into the second. Now the list provided by Help will be displayed one screen at a time, controlled by More.

Finally, you can get Help on More:

Help More

Note that there is no pipe character – the word “More” was provided as a parameter to the Help command, asking it to display information about the command “More”.

If that’s longer than your window is tall, you can pipe that output into More so you can see it a screen at a time:

Help More | More

In English, that’s running the Help program, asking for help on “More”, and then piping that output through the program “More” so as to display one screenful at a time.

Comment on today's tip here: Tip of the Day: Help and More

(Login with your Ask Leo! Members Area - account.)

- * -

Have a question? An idea or request for a future Tip of the Day? Use Ask Leo! for Patrons to drop me a line.

Access the entire Tip of the Day library, as well as any other patron's benefits you're entitled to by visiting the Ask Leo! Patrons Page.

Contents Copyright ©

Leo A. Notenboom & Puget Sound Software, LLC.

Ask Leo! is a registered trademark ® of Puget Sound Software, LLC

Our records show that mocchau@yahoo.com

confirmed your subscription on July 25, 2014.

To unsubscribe from all Ask Leo! mailings, or to change your subscription email address, just click the link below.

P.O. Box 2841,

Woodinville, WA 98072, USA