Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have two problems with the echo command not displaying as I would like.
The system reads the second line as “echo on”. Can a line starting with the word “on” follow the echo command and still display properly? Is there a work-around?
echo I want to go home
echo on Friday.
I cannot get the second line to display:echo Add this line to BATCHFILE.BAT:
echo if exist c:\GdCookie\nul xcopy /y c:\GdCookie\*.* c:\Windows\Cookies>nul(These are instructions I want to display on screen about how to add a line to a batch file. (GdCookie is a folder. The line works in the batch file; I just can’t get it to display properly.)
It displays if I use quotes, but I don't want the quotation marks to show up.
======================================================
It is the mark of an educated person never to demand more precision than the nature of the subject allows. (Aristotle) But I don’t want any less, either.

RM,This had me stumped for a while, though this is not the perfect solution it might be of help.
It bypasses the 'echo on' command but indents the text by one character.
echo+[space]your text
The + sign must be included directly after echo.
Regards
Huey

The "offical" documented way to do this is to use the period after echo. I have never seen the + documented as working (supported).
But I have seen it in Batch files from Microsoft.ECHO.On Friday
This is an extension of "ECHO." being defined as the way to insert a blank line in the output of a batch file.
It is recommended that the redirected output to nul: use the form ">>nul" instead of just ">nul". While not a problem in Windows, in some versions of Real DOS x.xx, the repeated use of ">nul" will use up all the available file handles and can cause an Open file to be closed. Ran into the problem one time when logging output of commands to files from some commands and not others.The ">" causes a new file handle to be opened and used, were the ">>" is append to existing file handle used for nul:.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |