Windows Command Prompt Help and Documentation
last modified July 14, 2025
The Windows Command Prompt provides built-in help and documentation features. These tools help users understand command syntax and available options. Proper use of help resources is essential for effective command line usage. This tutorial covers all aspects of Command Prompt help functionality.
Command Prompt help comes in several forms: command help switches, the HELP command, online documentation, and error messages. Each serves different needs and provides varying levels of detail. Learning to use these resources will make you more proficient with cmd.
The most basic help is available through the /? switch supported by most commands. For more detailed information, the HELP command provides a comprehensive list of available commands. Microsoft's online documentation offers the most complete reference material.
This tutorial will demonstrate practical examples of accessing and using Command Prompt help. We'll cover basic command help, advanced syntax, finding commands by purpose, and interpreting help output. These skills are fundamental for all command line users.
Basic Command Help with /?
The /? switch provides quick syntax help for any command. It shows basic usage, parameters, and common options. This is the fastest way to get command-specific help.
@echo off echo Displaying help for XCOPY command: xcopy /?
This simple script demonstrates how to access basic help for the XCOPY command. The /? switch works with nearly all built-in commands.
xcopy /?
Displays the help documentation for the XCOPY command. The output includes command syntax, parameters, and examples of common usage scenarios.
C:\>basic_help.bat Displaying help for XCOPY command: Copies files and directory trees. XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/B] [/J] [/EXCLUDE:file1[+file2][+file3]...] source Specifies the file(s) to copy. destination Specifies the location and/or name of new files. /A Copies only files with the archive attribute set...
The output shows the first part of XCOPY's help. It continues with detailed explanations of each parameter. Scroll up to see the complete help text.
Using the HELP Command
The HELP command provides a comprehensive list of available commands. It can also display detailed help for specific commands. This is more thorough than the /? switch for some commands.
@echo off echo Listing all available commands: help echo Displaying detailed help for FOR command: help for
This script shows two uses of the HELP command: listing all commands and displaying detailed help for a specific command (FOR in this case).
help
Lists all available commands in Command Prompt. The output is categorized into internal commands, external commands, and batch file commands.
help for
Displays detailed help for the FOR command. This includes complete syntax, examples, and explanations of all variations of the FOR loop.
C:\>help_command.bat Listing all available commands: For more information on a specific command, type HELP command-name ASSOC Displays or modifies file extension associations. ATTRIB Displays or changes file attributes. BREAK Sets or clears extended CTRL+C checking. ... Displaying detailed help for FOR command: Runs a specified command for each file in a set of files. FOR %variable IN (set) DO command [command-parameters] %variable Specifies a single letter replaceable parameter. (set) Specifies a set of one or more files. Wildcards may be used. command Specifies the command to carry out for each file. command-parameters Specifies parameters or switches for the specified command.
The output first shows a partial list of commands, then detailed FOR command help. The complete list includes dozens of commands.
Finding Commands by Purpose
When you need to perform a task but don't know the command, you can search the help system. The HELP command combined with FINDSTR helps locate relevant commands by keyword.
@echo off echo Searching for commands related to 'network': help | findstr /i "network" echo Searching for commands related to 'time': help | findstr /i "time"
This script demonstrates how to find commands by their purpose or function. The /i switch makes the search case-insensitive.
help | findstr /i "network"
Lists all commands whose help description contains "network". The pipe (|) sends HELP output to FINDSTR for filtering.
help | findstr /i "time"
Lists commands related to time operations. This technique helps discover commands when you know what you want to do but not the command name.
C:\>find_command.bat Searching for commands related to 'network': NETSH Invokes a separate command interpreter that allows you to... NETSTAT Displays protocol statistics and current TCP/IP network... PATHPING Traces route and provides network latency and packet loss... PING Verifies IP-level connectivity to another TCP/IP computer... Searching for commands related to 'time': DATE Displays or sets the date. TIME Displays or sets the system time. TIMEOUT Waits the specified number of seconds...
The output shows commands related to networking and time management. This technique works for any keyword that might appear in command descriptions.
Advanced Command Syntax Help
Some commands have complex syntax that requires detailed explanation. The HELP command often provides more thorough documentation than /? for these cases. This example examines the FOR command's advanced help.
@echo off echo Displaying advanced help for FOR command: help for echo Displaying help for FOR /F variant: for /?
This script compares the output of HELP FOR with FOR /?. Some commands provide different information through these two help methods.
help for
Shows the complete help documentation for the FOR command. This includes all variants (FOR, FOR /D, FOR /R, FOR /L, FOR /F) with examples.
for /?
Displays the command-line help for FOR. This often shows slightly different information than HELP FOR, especially for complex commands.
C:\>advanced_help.bat Displaying advanced help for FOR command: Runs a specified command for each file in a set of files. FOR %variable IN (set) DO command [command-parameters] %variable Specifies a single letter replaceable parameter. (set) Specifies a set of one or more files... Displaying help for FOR /F variant: FOR /F ["options"] %variable IN (file-set) DO command [command-parameters] FOR /F ["options"] %variable IN ("string") DO command [command-parameters] FOR /F ["options"] %variable IN ('command') DO command [command-parameters]
The output shows how HELP FOR provides general information while FOR /? focuses on specific syntax variants. Both are valuable references.
Online Documentation and Resources
For the most complete and up-to-date command reference, Microsoft's online documentation is essential. This example shows how to access it from cmd.
@echo off echo Opening command reference in default browser: start https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands echo Searching online for robocopy documentation: start https://learn.microsoft.com/en-us/search/?terms=robocopy
This script demonstrates accessing online documentation directly from cmd. The START command launches the default web browser with the specified URL.
start https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands
Opens Microsoft's official Windows command reference in your default browser. This contains the most complete and current command documentation.
start https://learn.microsoft.com/en-us/search/?terms=robocopy
Searches Microsoft Docs for ROBOCOPY documentation. This technique works for any command you need detailed information about.
C:\>online_help.bat Opening command reference in default browser: Searching online for robocopy documentation:
The script launches web pages but produces no console output. The browser will display the requested documentation pages.
Source
In this article, we have covered Windows Command Prompt help and documentation. These resources are essential for effective command line usage and scripting.