Skip to main content

Command referenceecho

echo command (Windows / CMD)

WindowsCMDtextbeginner

What it does

Display text or control command echoing in a batch script. Searches for the echo command cmd usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.

Display text or control command echoing in a batch script.

Syntax

echo [on | off] | echo [message]

Common options

Flag / optionMeaning
echo offStop displaying subsequent batch commands.
echo onResume command display.
echo.Print a blank line in common CMD usage.
@Suppress echo for one batch command.

Practical examples

Print message

echo Build complete

Writes a status line.

Quiet batch

@echo off

Hides the command itself and following commands.

Write file

echo enabled=true>app.ini

Creates or replaces app.ini.

Linux ↔ Windows equivalent

Closest match: echo (Linux / bash / sh / zsh). Write arguments and shell-expanded values to standard output.

Common mistakes

  • Forgetting that `>` replaces a file while `>>` appends.
  • Printing special characters such as `&` or `|` without escaping them.

FAQ

What does echo do in Command Prompt?

Display text or control command echoing in a batch script.

How do I run echo in CMD?

Open Command Prompt and follow `echo [on | off] | echo [message]`; quote paths containing spaces.

What is a practical echo example in CMD?

Try `echo Build complete` — Writes a status line.

Can echo be used in a batch file?

Yes. Check its exit code and escape CMD metacharacters when input is variable.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.