1

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

4

1 回答 1

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
于 2016-04-28T02:03:13.833 回答