Why is an "@" used in batch files ?

Posted on 2009-02-11
Last Modified: 2012-05-06
please advise
Question by:itbabe
    LVL 67

    Accepted Solution

    @ temporarily turns the echo off...which hides the output of normal commands during processing.
    Which is why you use them both on the first line:

    @echo off

    so that command is hidden as well..
    LVL 67

    Expert Comment

    You could also use

    @dir c:\ > c:\dirlist.txt
    @type dirlist.txt|find /i "data"
    @for %%a in (c:\dirlist.txt) do echo %%a

    but the foremost echo off, eliminates the need to precede each line with @

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
    Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now