windows - How do I stop my batch file from printing the code it is running?

ID : 274499

viewed : 43

Tags : windowsbatch-filewindows





Top 2 Answer for windows - How do I stop my batch file from printing the code it is running?

vote vote

97

To avoid echoing the Windows commands in a batch file, use @echo off:

@ECHO OFF FOR %%i IN (1 2 3) DO (          IF %%i==1 (         ECHO %%i      )     IF %%i==2 (         ECHO %%i      )     IF %%i==3 (         ECHO %%i      ) ) 

Note the preceding @ in echo off prevents echo off from echoing. If you don't have the @ then you'll see echo off echoed to the terminal but then echoing will be off after that point. A batch file command which is preceded by @ is not echoed. So @ can be used to prevent echoing of individual commands.

vote vote

87

Top 3 video Explaining windows - How do I stop my batch file from printing the code it is running?







Related QUESTION?