How do I make a Windows batch script completely silent?

后端 未结 5 1827
天涯浪人
天涯浪人 2020-12-13 03:33

There has been variants of this question asked for generations, but despite writing some quite complicated Windows scripts, I can\'t seem to find out how to make them actual

5条回答
  •  被撕碎了的回忆
    2020-12-13 04:08

    You can redirect stdout to nul to hide it.

    COPY %scriptDirectory%test.bat %scriptDirectory%test2.bat >nul
    

    Just add >nul to the commands you want to hide the output from.

    Here you can see all the different ways of redirecting the std streams.

提交回复
热议问题