如何擦除批处理文件中的暂停

1 batch-file pause

我正在制作一款名为 Text Adventure 的游戏。这不是什么大问题,但我想知道如何Press any key to continue . . . 在用户按下键后删除,而不是使用 cls 也会清除标题屏幕。除了使用 cls 并复制和粘贴标题屏幕之外,还有其他建议吗?

Aac*_*ini 5

@echo off
setlocal EnableDelayedExpansion

rem Get a CR control char
for /F %%a in ('copy /Z "%~F0" NUL') do set "CR=%%a"

rem Show the 'pause' message
set /P "=Press any key to continue . . ." < NUL
rem Execute 'pause', but don't show anything on screen
pause > NUL
rem Show a CR and enough number of spaces to delete previous message
set /P "=.!CR!Ready...                        " < NUL
Run Code Online (Sandbox Code Playgroud)