How do I clear ONLY ONE LINE of cmd?

后端 未结 1 1338
灰色年华
灰色年华 2020-12-20 10:16

So, I have added some stuff in cmd. I want there to be a progress bar using text, so that it is like [......... ], but when I type in CLS to clear the line and ECHO to rem

1条回答
  •  庸人自扰
    2020-12-20 10:55

    Use something like this:

    @echo off
    setlocal enableDelayedExpansion
    
    :: Define CR to contain a carriage return (0x0D)
    for /f %%A in ('copy /Z "%~dpf0" nul') do set "CR=%%A"
    
    nul
    nul
    nul
    

    From here

    0 讨论(0)
提交回复
热议问题