Echo off but messages are displayed

后端 未结 5 1825
梦谈多话
梦谈多话 2021-01-30 15:40

I turned off echo in bat file.

@echo off

then I do something like this

...
echo %INSTALL_PATH%
if exist %INSTALL_PATH%(
echo 22         


        
5条回答
  •  长情又很酷
    2021-01-30 16:13

    Save this as *.bat file and see differences

    :: print echo command and its output
    echo 1
    
    :: does not print echo command just its output
    @echo 2
    
    :: print dir command but not its output
    dir > null
    
    :: does not print dir command nor its output
    @dir c:\ > null
    
    :: does not print echo (and all other commands) but print its output
    @echo off
    echo 3
    
    @echo on
    REM this comment will appear in console if 'echo off' was not set
    
    @set /p pressedKey=Press any key to exit
    

提交回复
热议问题