This is probably impossible, but I have a loop that displays a animated logo by using TYPE
to type logo_(framenumber).txt
and the framenumber
is determined by a loop:
:s
if %m%==379 set m=0
cls
TYPE Logo_%m%.txt
set /a m=%m%+1
goto s
I wanted to be able to use a set /p
option and without disturbing/stopping the loop so the animation plays while a user is typing in the set /p
input. I think there is a way to do it with FOR
but I'm not sure how. Any ideas? Thanks.
Although this topic is somewhat old, I just discovered it. This is a pure Batch file solution that works pretty well:
EDIT: I slightly modified the code in order to made it simpler.
In this solution the animated "logo" is replaced by a banner, but the method to display a series of files is practically the same.
EDIT: This is possible in batch. See Aacini's answer.
This is not possible with batch files. Batch commands are single-threaded. To run two things simultaneously requires two instances of cmd.exe. But the console subsystem only allows one program to own the console at a time, so if the second instance of cmd is attached to the same console, one of them must be blocked.It is possible to do something like this with a win32 executable which uses
WriteConsoleOutput
to modify the characters on the console screen. If you do that, you are no longer limited to just dumping text files, but the downside is that it's a lot more work than callingtype
in batch.