When running bat files, how to show commands but not "rem"ed out lines?
When running a bat file, I'd like to see the commands being executed but not anything rem'ed out.
The problem is that it seems to be all or nothing. When using "echo off" nothing shows except the results of the commands, like "2 files copied". But when not using echo off, everything, including lines rem'ed out, shows while it runs. This makes the screen cluttered and hard to read.
How can I set it to see both the command (copy this there, or whatever) and the results too but nothing rem'ed out?
(I don't want to install any software as a solution)
Thanks.
Solution 1:
Regardless of the ECHO setting within a batch file, any line that starts with the @
character will not print out. To prevent the REM lines from being displayed, leave ECHO ON ad put @
in front of the REM lines so that they would be:
@REM This won't be echo'd
@REM even with ECHO ON
Solution 2:
You can use ::
as an alternative comment prefix; such lines are parsed as invalid labels and are never displayed.