Help (HELP and /?)

Maintained on

If you ever wonder “what options does this command have?”, you don’t need to search the web. Command Prompt can tell you by itself.

This article explains how to use the HELP command and the /? option, and how to read the syntax they display.

Listing available commands

Running help with no arguments displays a list of the main commands that have help available.

Syntax
help
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>help
For more information on a specific command, type HELP command-name
ASSOC Displays or modifies file extension associations.
ATTRIB Displays or changes file attributes.
…
C:\users\user>
Some commands are not in the list

Commands such as ping and ipconfig do not appear in the help list. You can look them up with the /? option described below.

Showing help for a specific command

HELP command-name

Specify a command name after help to see detailed usage for that command.

Syntax
help command-name
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>help cd
Displays the name of or changes the current directory.
…
C:\users\user>
おすすめ書籍※ 広告を含む場合があります
中小企業経営者のためのRPA入門 RPA導入を成功させる方法

中小企業経営者のためのRPA入門 RPA導入を成功させる方法

60分でわかる! AIエージェント 超入門

60分でわかる! AIエージェント 超入門

コマンドラインの黒い画面が怖いんです。

コマンドラインの黒い画面が怖いんです。

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

知識・才能ゼロでもらく~に月10万円稼ぐ! よくわかるAI副業超入門

command-name /?

Adding /? after a command name also displays its help.

Syntax
command-name /?
- □ ×
Command Prompt Icon
Command Prompt
Microsoft Windows [Version xx.x.xxxxx.xxx]
(c) 2026 Ribbit App Development All rights reserved.
 
C:\users\user>dir /?
Displays a list of files and subdirectories in a directory.
…
C:\users\user>

help dir and dir /? show almost the same content.

MethodCharacteristics
help command-nameWorks only for commands in the help list
command-name /?Also works for external commands (ping, ipconfig, etc.)
When in doubt, use /?

Many commands support /?, including ones missing from the help list. Try /? first.

Some commands do not support /?

Some commands use -? or --help instead of /?. For example, tar and curl show help with --help. If /? does not work, try these as well.

Reading the syntax

The syntax shown in help uses its own notation. For example, near the top of dir /? you will see a line like this:

Syntax
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]

The main notation rules are:

NotationMeaning
[ ]Optional item
No [ ]Required item
A | BSpecify either A or B
...The item can be repeated

Because every item of dir is enclosed in [ ], you can run it without specifying anything.

Making long help easier to read

For commands with long help, such as for /? or set /?, the top of the text scrolls off the screen. These techniques make it easier to read.

Show one screen at a time

Pass the output to the more command with a pipe. Press the space bar for the next screen and q to quit.

Example
for /? | more

Save to a file

Use redirection to save the help text to a file.

Example
for /? > for-help.txt

You can then open the file in Notepad and read it at your own pace.

Search for only the part you need

Combine it with the findstr command to find only the lines containing a particular string. /C: is needed because otherwise /B would be parsed as an option of findstr itself.

Example
dir /? | findstr /C:"/B"

Differences from PowerShell

In PowerShell, help is a function that wraps Get-Help (with paging), so its output differs from Command Prompt. Typing dir /? in PowerShell also does not show the Command Prompt help.

To see Command Prompt help, run the command in Command Prompt, or from PowerShell with something like cmd /c dir /?.

Summary

  • Running help alone lists the commands that have help available
  • help command-name or command-name /? shows how a command works
  • /? also works for external commands, so try it first
  • In the syntax, [ ] means optional and | means a choice
  • Use | more or > filename to make long help easier to read

Practice questions

Question 1

Which command correctly shows how to use the xcopy command?

Choose one answer.

  1. xcopy /?
  2. xcopy ?
  3. xcopy \?

Question 2

In help syntax, what does an item enclosed in [ ], such as [/B], mean?

Choose one answer.

  1. An optional item
  2. A required item
  3. An item that requires administrator rights

Question 3

Which command displays long help one screen at a time?

Choose one answer.

  1. for /? | more
  2. for /? > more
  3. more | for /?
#Command Prompt #Batch File #HELP #Help #Options