batch-file Echo

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

echo can be used to control and produce output.

Syntax

  • ECHO [ON | OFF]
  • ECHO message
  • ECHO(message
  • ECHO(

Parameters

ParameterDetails
ON | OFFCan either be ON or OFF (case insensitive)
messageAny string (except ON or OFF when used without ()

Remarks

  • echo. will also display an empty string. However, this is slower than echo( as echo. will search for a file named "echo". Only if this file does not exist will the command work, but this check makes it slower.
  • echo: will behave just like echo(, unless message looks like a file path, e.g. echo:foo\..\test.bat. In this case, the interpreter will see echo:foo as a folder name, strip echo:foo\..\ (because it appears just to enter the directory echo:foo then leave it again) then execute test.bat, which is not the desired behaviour.


Got any batch-file Question?