batch file - Difference between "@echo off" and "@echo %off"? -
at beginning of batch script, saw command:
@echo %off
to surprise has same effect of:
@echo off
what effect of '%' prefix?
i've never seen before. doesn't work in cmd console -- in .bat script. have guess.
in cmd console window if @echo off
, results in command prompts being hidden, in .bat script. reveal prompts again, have echo on
. difference in .bat script, percent signs need doubled represent literal %
string character, whereas in cmd console not. result @echo %off
in cmd console results in string %off
being echoed stdout.
with in mind, i'm guessing author intended hack avoid problems encountered users copypaste script cmd console window, rather intended .bat script. %
added, command neutered in console, still achieves intended effect when run .bat script. without %
, console appear hang after instructions have completed.
Comments
Post a Comment