Collections:
Other Resources:
"echo on|off" - Control Echo Setting
How to change the default echo behavior with the "echo on|off" command?
✍: FYIcenter.com
By default, when a command is executed in a batch file,
the command will be echoed on the screen before the execution.
But this behavior can be changed by running the "echo" command.
1. "echo on" - Change the setting to echo all commands.
2. "echo off" - Change the setting to stop echo all commands.
So if you want to stop echoing all commands in the batch file, you can start the batch file with "@echo off". The "@" modifier stops echoing the "echo" command itself.
If later in the batch, you want to resume echoing commands, just insert the "echo on" command.
Here is batch file called, Echo-Off-and-On.bat, which uses the "echo" command to control the echo behavior:
@echo off echo Running command privately for 10 seconds, don't move... ping -n 10 localhost > nul 2> nul echo Running the same command publicly now... echo on ping -n 10 localhost
if you run the above batch file, you get:
C:\fyicenter>Echo-Off-and-On.bat
Running command privately for 1 minute, don't move...
Running the same command publicly now...
C:\fyicenter>ping -n 10 localhost
Pinging localhost [::1] with 32 bytes of data
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Ping statistics for ::1:
Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
⇒ %1 and %* - Receive Parameters in Batch File
⇐ "@" - Stop Echoing the Command
2021-07-10, ∼5193🔥, 0💬
Popular Posts:
What is the startup program "CyberLink MediaLibray Service - CLMLSvc_P2G8.exe" on my Windows 8 compu...
How can I get detailed system information from my Windows Server 2012? A quick way to get detailed i...
What is "Pml Driver HPZ12" in my Windows 7 service list? And how is "Pml Driver HPZ12" service relat...
Can I remove startup application "RealPlay.exe - RealPlayer Tray Bar Application" to speedup my comp...
What is "Software Protection" in my Windows 7 service list? And how is "Software Protection" service...