Structure of a batch file Syntax: echo off cmd
If you have created a batch file, you can write a command in each line, see: how to create a batch file - basics. The commands are executed in sequence when the file is started. The behavior of the output can be adjusted as follows:
echo @ or @echo off
@ resp. @echo off control the display of the batch file
Without the @ command in front of each command, the command line and then the result is always displayed when the batch file is executed:
to illustrate a small example using the “echo” command:
The echo command prints a text in the output:
Batch file contents:
echo a Text
Output:
echo a Text
a Text
an @ before a command suppresses the output of the command line:
Batch file contents:
@echo hello
Output:
hello
In the output the call of the command is suppressed: “echo a text”.
To not have to write an “@” in front of each command, there is the command “echo off”.
To suppress the output of the command “echo off” itself, you can then use “@echo off”.
Contents of the batch file:
@echo off
echo hello
Output:
hello
see also: Practical examples with batch
rem: Comments in the batch file
To insert comments in a batch file, the “rem” command is used.
Contents of the batch file:
rem echo this is a comment
ignores the complete line: Nothing is output
pause
the pause command, stops the batch file and waits until any key is pressed.
@echo off
echo hello
pause
Output:
hello
Press any key . . .

{{percentage}} % positive

THANK YOU for your review!
Top articles in this section
The function wait or sleep was not available in BATch files by default.Remedy is a small detour via the ping Command
Handling variables in Windows Batch (command prompt) Read all variables Variables can be read out in the command prompt with the set command:
The pstools can be used to execute commands on other computers: Of course, this requires the necessary rights for the remote connection: by default, these are the domain administrator or the local administrator. As an alternative for a remote connection to another computer, PowerShell remoting can also be used, see: Powershell Remote