Change output of pause command in batch script

后端 未结 9 536
孤独总比滥情好
孤独总比滥情好 2020-12-24 11:14

I\'m writing a Windows batch script. By default, the pause command will pause the script and display the text "Press any key to continue...".

9条回答
  •  清歌不尽
    2020-12-24 12:02

    You could hide the text from the pause command by using this:

    pause >nul

    Then you could echo your own message to tell the user it has paused:

    echo The batch file has paused

    So the full script might look like this:

    @echo off
    echo Hello World!
    echo The batch file has paused
    pause >nul
    

    Hope this helps :)

提交回复
热议问题