It's programming time!/Batch/Echo

From Create Your Own Story

(Difference between revisions)
m (Echo)
m
Line 28: Line 28:
*[[It's_programming_time!/Batch/Pause|There's still a pause. Why do we need it?]]
*[[It's_programming_time!/Batch/Pause|There's still a pause. Why do we need it?]]
*[[It's_programming_time!/Batch/Dir|Boring, show me something cool.]]
*[[It's_programming_time!/Batch/Dir|Boring, show me something cool.]]
 +
 +
[[Category:It's programming time!|Batch]]
 +
[[Category:It's programming time!/Batch|Echo]]

Revision as of 02:30, 16 July 2016

Echo

The ECHO command repeats back messages or toggles the command prompt display. It's one of the most basic batch commands.

Let's see what echo can do for you:

  1. Create a new batch file like we did earlier and open it in your text editor.
  2. Add the following lines to the file:
@echo Using echo without any following text will give you a status message
@echo

@echo OFF
echo "echo OFF" can also be used to disable the command prompt display.
rem @echo OFF is a good line to start your batch files with.

echo Now we no longer need to use the @ symbol in front of each command.
echo

pause
  1. Save your file without any formatting (Plain text).
  2. Double click your .bat file to execute the commands.

Remember: Don't edit the batch file while it's running. You can get unexpected errors that way.

Personal tools