How to get help for any command

Overview

Most built-in CMD commands explain themselves through help command or command /?.

Help output shows syntax, options, and examples. In syntax lines, brackets usually mean optional text; do not type the brackets themselves.

  • help lists many built-in commands.
  • help copy explains a specific CMD built-in.
  • command /? also works for many executable programs.

Commands to try

Type each command at the prompt, then press Enter. Replace sample names and paths with ones that exist on your computer.

Commands are generally not case-sensitive, but preserving the spelling shown here makes scripts easier to read.

help
help copy
copy /?
robocopy /? | more

Useful options and details

Options change how a command behaves. Add spaces exactly as shown, and use the command's built-in help when an option is unfamiliar.

A path containing spaces must be enclosed in double quotes, such as "C:\My Files".

  • Pipe long output to more; press Space for another page or Q to stop.
  • Text such as source and destination represents values you supply.
  • Online examples may target PowerShell or Linux, so verify that they are labeled for Command Prompt.

Tips and common mistakes

Check the current folder and read the command output before assuming an operation succeeded.

Practice with disposable files first. Commands that delete, overwrite, or stop a process may not offer an Undo button.

  • Read whether an option deletes, overwrites, or forces an action before running it.
  • A slash option such as /S can mean different things for different commands.
  • If help does not recognize an external program, try its /?, -h, or --help option.

Safe practice

Create a temporary practice folder under your user profile so the examples cannot affect Windows system files.

After each command, inspect the result with dir or another read-only command before continuing.

  • Compare help dir with dir /?.
  • Find the option that makes dir pause.
  • Quit paged help without changing files.