ECHO: Displays messages, or turns command echoing on or off.


 


... The examples for the command "ECHO"
... "ECHO" Excerpt from Microsoft Windows Help
... Important information, tips for the "ECHO" command

The command: "ECHO" is on Windows 12, 11, 10, .. , MS Server 2025, 2022, 2019, .. available

The examples for the command "ECHO"

The `ECHO` command in Windows Command Prompt is used to output text to the screen. Here are some examples: Example 1: Simple text expression:

ECHO Hello, world!

Description: Returns the text "Hello, world!" on the screen. Example 2: Save text to a file:

ECHO This is an example > example.txt

Description: Creates a file named "Example.txt" and stores the text "This is an example" in it. Example 3: ECHO without line break:

ECHO| SET /P=This text is output without line breaks

Description: Outputs the text without adding a line break. Example 4: Variables and ECHO:

SET Name=John
ECHO My name is %Name%

Description: Uses a variable and prints the text "My name is John". Example 5: ECHO in a batch file:

@ECHO OFF
ECHO This is a batch file.
ECHO Press a button to continue...
PAUSE > ZERO

Description: A simple batch file that outputs text and waits for user input. Example 6: ECHO in a loop:

FOR /L %i IN (1, 1, 5) DO ECHO This is line %i

Description: Uses a loop to output the text "This is line [number]" five times. Example 7: Show help:

ECHO.
ECHO Example: Using the ECHO command
ECHO.

Description: Uses ECHO to output a blank line and a heading. The `ECHO` commands are useful for displaying information while running batch files or while working in the command prompt. Note that some special characters, such as `>` or `|`, have special meanings when used in conjunction with `ECHO` and may need to be treated differently. In this case, you could use quotation marks or escape the special characters with a double arrow (`^>`, `^|`).

"ECHO" Excerpt from Microsoft Windows Help

Microsoft Windows [Version 10.0.19045.3693]
(c) Copyright 1985-2023 Microsoft Corp.

C:\\WINDOWS>

Displays messages, or turns command-echoing on or off.

  ECHO [ON | OFF]
  ECHO [message]

Type ECHO without parameters to display the current echo setting.

Important information, tips for the "ECHO" command

There are a few important aspects to keep in mind when using the `ECHO` command in the Windows Command Prompt: 1. Special character output: Some special characters, such as `>` or `|`, may produce undesirable results when used directly with `ECHO`. In such cases, it is advisable to use quotation marks or escape the special characters.

    ECHO "This is an example with > and |"
    ECHO This is an example with ^> and ^|
    
2. ECHO in batch files: In batch files, it is common practice to use `@ECHO OFF` at the beginning to suppress the output of each command in the batch file. Then if you want to print out specific commands, you can use `@ECHO ON` or `ECHO` in the batch file. 3. Variables and ECHO: When using variables in conjunction with `ECHO`, you must ensure that you reference the variables correctly. Variable names are enclosed with `%`.

    SET Name=John
    ECHO My name is %Name%
    
4. ECHO redirection: You can redirect the output of `ECHO` to a file. For example:

    ECHO This is an example > example.txt
    
5. ECHO and Pipe (`|`): If you use `ECHO` with a pipe (`|`), make sure it is a single command. In a batch context it might be necessary to use `CALL ECHO` when combining ECHO with a pipe.

    CALL ECHO This is an example | MORE
    
6. ECHO without newline: If you want to use `ECHO` without newline, you can use `SET /P`.

    ECHO| SET /P=This text is output without line breaks
    
7. Empty line with ECHO: If you want to output an empty line, you can just use `ECHO.`.

    ECHO.
    
8. Use escape characters: When working with special characters directly in the command prompt, it may be necessary to use escape characters (`^`) to prevent unwanted effects.

    ECHO This is an example with ^> and ^|
    
9. Show Help: You can use `ECHO` to show help text or instructions while running batch files.

    ECHO.
    ECHO Example: Using the ECHO command
    ECHO.
    
It is important to consider the specific requirements of your task and ensure that `ECHO` is used correctly to achieve the desired results.


Deutsch
English
Español
Français
Italiano
日本語 (Nihongo)
한국어 (Hangugeo)
汉语 (Hànyǔ)
Türkçe
Português
Português
Svenska
Norsk
Dansk
Suomi
Nederlands
Polski









Windows-10


... Windows 10 FAQ
... Windows 10 How To


Windows 10 How To


... Windows 11 How To
... Windows 10 FAQ



The command ECHO - Displays messages, or turns command echoing on or off.

HTTP: ... console/en/025.htm
0.109
15416
Who needs the alternative cmd.exe and why?
Auto-Expand of the windows system favorites at program start?
Export the output of the command prompt (cmd.exe) TXT, RTF, HTML!
How do I recognize EFI system partitions under Windows 11, 10, ...?
In neuem Prozess öffnen Kontextmenü, Menüpunkt entfernt?
Help the airplane mode switch is missing on Windows 11?
Which is better, 1920x1080, 1920x1200 or 1680x1050?
Adjust the duration of the windows 11 lock screen?
Keyboard shortcuts window customize under Windows, with examples!
Windows 12 64-Bit-Download?



(0)