Search Tools Links Login

Using @ in Batch Files


In a batch file, the at sign (@) is used as a prefix before a command to suppress its output from being displayed on the console. When a command is prefixed with an at sign, only the output generated by the command is hidden, while the command itself is still executed.

Here's an example to illustrate its usage:

@echo off
@echo This line will not be displayed on the console
echo This line will be displayed

In the above example, the first echo command is prefixed with an at sign, so it will not be displayed on the console when the batch file is run. However, the second echo command is not prefixed with an at sign, so its output "This line will be displayed" will be shown on the console.

The at sign is often used in batch files to make the output less cluttered by hiding unnecessary or intermediate information, focusing only on the relevant output or results.

About this post

Posted: 2023-05-25
By: dwirch
Viewed: 269 times

Categories

Windows Commandline

Tutorials

Scripting

DOS

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.