SoFunction
Updated on 2025-03-09

Cool BAT font-reading special effect source code

First, the first version of the code.
There must be bugs in the code, so I will post it first for you to test it.

@echo off&setlocal enabledelayedexpansion
mode con: cols=87 lines=15
title code by foxjl 2007-12-1 
color 1a
set long=43,minus=43
set,=^
us,Is a group of persistent batch processing enthusiasts^
In colorfulWINDOWSDown,OpenCMDThis deep window^
Once a night fight,Once I've never sleeped all night^
us之所以如此似痴若狂,是因为us深知:^
The ruler is shorter、Have a little bit of strength,CMDExtraordinary^
us精益求精,Strive for perfection^
All efforts,Just to use the simplest language,Write the most practical code^
I^
Gathering of experts、Complete information、It's a blessed place for beginners、A paradise for veterans to advance^
Don't ask for the biggest、But for the best、Show the infinite charm of batch processing、Everything is wonderful,All in~~I~~                 Demo is finished。goodbye!!
:start
echo.
for %%i in (8 4 -1 4 -1 4 -1 10 -1 8 -1 16 -7 , 8 4 -1 4 -1 4 -1 10 -1 8 -1 8 -5 4 -1 4 -1 , 8 -4 2 -1 4 -1 10 -4 2 -1 12 -1 2 -7 , 8 4 -1 4 -1 4 -1 2 -1 6 -1 4 -1 2 -2 10 -1 2 -1 4 -1 4 -1 , 8 4 -1 4 -2 2 -2 6 -1 6 -1 2 -1 2 -1 4 -5 4 -1 4 -1 , 8 4 -2 2 -1 4 -1 8 -1 4 -1 4 -1 4 -1 6 -1 2 -7 , 8 -3 4 -1 4 -1 6 -1 2 -1 2 -1 4 -1 12 -1 8 -1 , 8 4 -1 4 -1 4 -1 12 -1 6 -1 12 -1 4 -5 , 8 4 -1 4 -1 2 -2 2 -1 8 -1 6 -1 12 -2 6 -1 , 8 4 -1 4 -2 2 -1 2 -1 6 -1 2 -2 2 -1 8 -2 10 -1 , 8 -3 4 -1 4 -3 2 -2 8 -5 8 -8) do (
(if "%%i"=="," (echo.&ping -n 1 127.1>nul)) && (set a=%%i)&(set b=!a:-=!)
 if %%i lss 0 (for /l %%j in (1,1,!b!) do (set/p=▓<nul)) else (for /l %%k in (1,1,%%i) do (set/p= <nul)
 )
)
call :delay 700
echo\&echo\
for /l %%z in (1,1,255) do (
if not !long! equ 0 set /a long-=1
for /l %%j in (1,1,87) do (set/p=<nul)
for /l %%k in (1,1,!long!) do (set/p= <nul)
set /a longn+=1
set /a longs=longn-43
set /a remnant=255-43
if !longn! lss 43 (set/p=!,:~0,%%z!<nul) else (
 if !longn! geq !remnant! (
  set /a minus-=1
  set /a minuss=minus*2
  for /l %%l in (1,1,!minus!) do (set/p= <nul)
  for /l %%j in (1,1,!minuss!) do (set/p=<nul)
  call set/p=%%,:~!longs!,43%%<nul
  ) else (
  call set/p=%%,:~!longs!,43%%<nul
  )
 )
call :delay 40 Modify this number to adjust the speed of the word.
)
call :delay 700&exit
:delay
for /l %%i in (1,1,%1) do (error>nul 2>nul)
goto :eof

The animation effect is very good, like the flying subtitles on TV. It is very ornamental.

It's really an open mind set , =^ Add a ^ symbol to the end of each sentence, and you can assign them all to variables. What's the principle? And there is no ^ symbol at the end of the last sentence?
However, the code seems to be more concise in the flying subtitles.

Let's take a look at the second version of the code

:
@echo off&setlocal enabledelayedexpansion
title code by Flooding° 2007-12-1 
mode con: cols=87 lines=15
for /l %%l in (1 1 42) do set "ko= !ko!"
color 1a&echo\&set,=!ko!^
us,Is a group of persistent batch processing enthusiasts^
In colorfulWINDOWSDown,OpenCMDThis deep window^
Once a night fight,Once I've never sleeped all night^
us之所以如此似痴若狂,是因为us深知:^
The ruler is shorter、Have a little bit of strength,CMDExtraordinary^
us精益求精,Strive for perfection^
All efforts,Just to use the simplest language,Write the most practical code^
I^
Gathering of experts、Complete information、It's a blessed place for beginners、A paradise for veterans to advance^
Don't ask for the biggest、But for the best、Show the infinite charm of batch processing、Everything is wonderful,All in~~I~~                 Demo is finished。goodbye!!
for %%i in (8 4 -1 4 -1 4 -1 10 -1 8 -1 16 -7 , 8 4 -1 4 -1 4 -1 10 -1 8 -1 8 -5 4 -1 4 -1 , 8 -4 2 -1 4 -1 10 -4 2 -1 12 -1 2 -7 , 8 4 -1 4 -1 4 -1 2 -1 6 -1 4 -1 2 -2 10 -1 2 -1 4 -1 4 -1 , 8 4 -1 4 -2 2 -2 6 -1 6 -1 2 -1 2 -1 4 -5 4 -1 4 -1 , 8 4 -2 2 -1 4 -1 8 -1 4 -1 4 -1 4 -1 6 -1 2 -7 , 8 -3 4 -1 4 -1 6 -1 2 -1 2 -1 4 -1 12 -1 8 -1 , 8 4 -1 4 -1 4 -1 12 -1 6 -1 12 -1 4 -5 , 8 4 -1 4 -1 2 -2 2 -1 8 -1 6 -1 12 -2 6 -1 , 8 4 -1 4 -2 2 -1 2 -1 6 -1 2 -2 2 -1 8 -2 10 -1 , 8 -3 4 -1 4 -3 2 -2 8 -5 8 -8) do (
(if "%%i"=="," (echo.&ping -n 1 127.1>nul)) && (set a=%%i)&(set b=!a:-=!)
 if %%i lss 0 (for /l %%j in (1,1,!b!) do (set/p=▓<nul)) else (for /l %%k in (1,1,%%i) do (set/p= <nul)
))
call :delay 700&echo\&echo\
for /l %%l in (1 1 255) do (
  set /p=!,:~0,43!<nul
  call :delay 40 Modify this number to adjust the speed of the word.
  for /l %%j in (1,1,87) do (set/p=<nul)
  set ,=!,:~1!
)
call :delay 700&exit
:delay
for /l %%i in (1,1,%1) do (error>nul 2>nul)
goto :eof