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.

hung console


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -