Displaying help for commands

While working with the Command Prompt, if you know what command you should use, but you aren't sure that you know the proper syntax and/or you don't know all of the options for it, you can usually display the help text for that command. To do this, type the command followed by a space, a forward slash, and a question mark. You must press Enter on your keyboard to have the Command Prompt run what you have typed. For example, if you want to see the help text for the CD command you would type:

CD /?

and then press the Enter key. What you would see at this point would be:

CHDIR [/D] [drive:][path]
CHDIR [..]
CD [/D] [drive:][path]
CD [..]

followed by some explanation of the syntax and options. Please note that CHDIR is treated as if it were the same command as CD. It is included in this help text to let you know that they are the same. If you display the help text for CHDIR you will see the same text.

If you would like to save the help text for a command as a file for later use, you can redirect the display output to a text file. To do this, add a space, the greater than symbol, and a filename with an extension that will be recognized as a text file (typically .txt or .log). If you want the file saved to a different directory, put a Path in front of the filename. Here is an example:

CD >C:\Users\Logon\CD.txt

See also: Command Line Basics articles