Echo command
The echo command repeats typed text back to the screen and can send text to a peripheral on the computer, such as a COM port.
Availability
Echo is an internal command that is available in the following Microsoft operating systems.
- All Versions of MS-DOS
- Windows 95
- Windows 98
- Windows Me
- Windows NT
- Windows 2000
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 10
- Windows 11
Echo syntax
Displays messages, or turns command-echoing on or off.
ECHO [ON | OFF] ECHO [message]
Type ECHO without parameters to display the current echo setting.
Echo examples
echo ata > com1
Depending on whether your modem was on com1, this command would make the modem try responding and a squealing noise from the modem. To stop the squealing, type echo atz > com1.
echo this is a test > test.bat
This command would put in the file test.bat "echo this is a test," then whenever you type in test, it would type in echo this is a test.
echo this is an example >> test.txt
The example above would echo "this is an example" then using ">>" would append that text into the test.txt file.
echo testing the echo string
This command would type on your screen, testing the echo string, and then take you back to the prompt.
echo ^<a href="http://www.computerhope.com/"^>Computer Hope^</a^> > test.htm
The above example would copy the HTML (hypertext markup language) code to create a hyperlink to Computer Hope into the test.htm file.
This example is also using the caret (^) to escape the less than and greater than characters.