Script Example:
@SET APPLY_ORA=YES
@REM ...
IF %APPLY_ORA%==YES (
@ECHO Doing Oracle
CALL %SOME_ORACLE_SPECIFIC_COMMAND% %SOME_ORACLE_SPECIFIC_FLAGS%
CALL %ANOTHER_ORACLE_SPECIFIC_COMMAND% %SOME_ORACLE_SPECIFIC_FLAGS%
) ELSE (
@ECHO Skipping Oracle
)
The idea is that I do not want to see IF YES==YES ( ) ELSE ( ) printed, particularly because it is split amongst multiple lines. I do however want to see the actual commands following CALL printed to the screen.
Now, I can make IF silent by appending an @ in front of IF
But that makes it too silent! I do not see the actual commands being used, only their output. How can I reach the point of perfection when using Dos Scripting. Thanks!
The other answers are unnecessarily complex or do not save the state of the echo (on or off). Simply prefix the command with an ampersand and change your statement: