Batch file: ECHO Command – How to

By | May 25, 2019

Batch file: ECHO Command – How to make a batch file echo command? Normally by default ECHO is turned on any batch file and when a batch file is being executed, then turn out the command for its successively on to the command line or prompt.

Batch file: ECHO Command - How to
You can also “turn off” ECHO by the nest line Below – (It’s simple)

@echo off

Need to turn on ECHO by Command:

@echo on

Read Also: How to Create Unique Named File From Batch Script

You can also turn off and turn on ECHO at any summit in the batch file. You can easily turn it on and turn it off by commands in the batch file.

Example: Look below the batch file named EchoExample.bat –

date /t
@echo off
echo echo turned off
date /t
@echo on
echo echo turned on
date /t
@echo off
echo echo turned off
date /t

When you run the batch file and below output –

c:\>echoExample.bat

c:\>date /t
Mon 02/13/2012
echo turned off
Mon 02/13/2012

c:\>echo echo turned on
echo turned on

c:\>date /t
Mon 02/13/2012
echo turned off
Mon 02/13/2012

c:\>

You need to execute the “date” command by 4 times, in the batch file. But you will see the command is “echoed” only 2nd in the output.

Read Also: How to Delete Temporary Internet Files Command Line

Leave a Reply

Your email address will not be published. Required fields are marked *