0

Is there a way to "cover text" so like this: I echo out "Hello world" but now I want to have it say "Pie is good" so I need it to print over it. I can not use cls because it flickers.

Edit:

I need to use lots of echos that I need it to start the text back at "0, 0,".

Silly
  • 217
  • 5
  • 9

2 Answers2

2

This is based on jeb's post at progress % within same line without cls.

@echo off
cls
setlocal EnableDelayedExpansion
call :BL.String.CreateCR

<nul set /p "=Hello world!CR!"
REM I will delay here so we can see it work.  You will do other processing
ping -n 2 127.0.0.1 > nul
<nul set /p "=Pie is good"
ping -n 2 127.0.0.1 > nul
echo.
pause
exit /b

:BL.String.CreateCR
::: CR should  be used only with DelayedExpansion
for /F "usebackq" %%a in (`copy /Z "%~dpf0" nul`) DO (
   set "cr=%%a"
)
exit /b
António Almeida
  • 9,620
  • 8
  • 59
  • 66
RGuggisberg
  • 4,630
  • 2
  • 18
  • 27
1

You could print a full page.

@ECHO OFF
ECHO ###############################################################################
ECHO #
ECHO # Hello World
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO ###############################################################################
PAUSE
ECHO ###############################################################################
ECHO #
ECHO # Pie is Good
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO #
ECHO ###############################################################################
PAUSE
Knuckle-Dragger
  • 6,644
  • 4
  • 26
  • 41
  • Interesting idea but not what I'm looking for. – Silly Feb 02 '14 at 01:22
  • You could use a solution found [here](http://stackoverflow.com/questions/14978548/windows-console-width-in-environment-variable) to make it more intricate. – unclemeat Feb 03 '14 at 22:17