how to: add text to the end of a line?

February 8, 2011 at 11:49:34
Specs: Windows 7, Phenom 8750 (3 core) - 4GB RAM
OK,

All I need to know is how to add a single character to the end of a line in a running batch file.,
for instance. I want the last line in my running batch file to look like this...

######################## - FINISHED!

but I want to add each character one at a time to give the illusion of a progress bar. Understand???

Any help would be great.
feel free to email me if you would like; EricZollman@gmail.com


See More: how to: add text to the end of a line?

Report •

#1
February 8, 2011 at 12:29:11
If you post the type of or some lines of your batch file that will make more sense.

Or try this idea...

cls
:: Line of your executable code
echo #
cls
:: 2nd line of code
echo ##
cls


Basic idea is to excute one line of code, clear the screen and display one extra # .
it wil give you illusion of progress bar...

Subhash Chandra.
www.s-chandra.co.cc


Report •

#2
February 8, 2011 at 15:04:03
Perhaps use "set /p":


@echo off

for /l %%a in (1 1 100) do (
    set /p =#<nul
    ping -n 1 0.0.0.0 >nul
)
pause

Obviously you probably wouldn't use the loop, the important thing is:

    set /p =#<nul


Report •

#3
February 9, 2011 at 03:04:27
Judago,
Thanks for the reply. With just a little tweeking the code works exactly as I wanted it to... Here is what I'm using now:

@echo off

for /l %%a in (1 1 40) do (
set /p =#<nul
ping -n 2 0.0.0.0 >nul
)
ECHO.
ECHO All files have been moved...
pause

Thanks again.
-Eric
-----------------------------------------------------------------
subhash

I tried using the CLS and ECHO method you mentioned but it just wasn't working right for what I had in mind. But thanks for the suggestion anyway.

-Eric


Report •
Related Solutions


Ask Question