How to echo the text "on" or "off" only?

Everyone knows that in the Windows batch file ( .cmd )

 echo on echo off 

enables and disables echo. But how does the echo only text β€œon” or text β€œoff”? That is how to send text

 on off 

to stdout ?
Target system: Windows XP.
And how to do it in DOS?

+7
windows cmd echo batch-file
source share
1 answer
 C:\> echo.on on C:\> echo.off off 

This actually works with several different characters, including, but not limited to:

/ , \ : , ; , ( .

According to this thread on dostips.com, this is really the best (most reliable) to use:

 echo(on 

Like other characters, there are unclear situations in which they may fail (for example, a file named echo exists on %PATH% ).

+8
source share

All Articles