CLS (clear) a single line?

后端 未结 4 1006
南旧
南旧 2020-12-03 18:24

Is there any way to CLS a single line of output? I don\'t believe there are any switches for CLS, so maybe a better question would be:

4条回答
  •  旧巷少年郎
    2020-12-03 18:59

    If you only need to move the cursor in one line (like your sample),
    it's possible with a carriage return character.

    @echo off
    setlocal EnableDelayedExpansion
    for /f %%a in ('copy /Z "%~f0" nul') do set "CR=%%a"
    for /L %%n in (5 -1 1) do (
       nul
    )
    

提交回复
热议问题