Ghost-typer effect in batch: Flickering random letters before each character
Posted: 15 Aug 2025 07:15
Hi everyone,
I’ve been experimenting with a batch “ghost-typer” effect, where text appears on the console as if it’s being typed live. I’d like to enhance it so that before each actual character is printed, a random character flickers in place. This would simulate a “hacking / sci-fi terminal” effect.
Here’s the basic code I started from (from an old Stack Overflow post):
Right now, the code types the letters, but the “random flicker” effect is not implemented yet. I’ve tried adding random characters as placeholders, but I’m struggling to make it work reliably while keeping the actual spaces in words intact.
Specifically:
I want each letter to first briefly appear as a random character (chosen from A-Z, 0-9, and some symbols) and then be replaced by the correct letter.
Spaces between words should appear normally.
Timing should be adjustable for a cinematic typing effect.
Some how I manged to do exactly what I wanted some years ago. But sadly ive lost the code
Has anyone successfully implemented something like this in pure batch? Any guidance or example code would be greatly appreciated.
Thanks in advance
I’ve been experimenting with a batch “ghost-typer” effect, where text appears on the console as if it’s being typed live. I’d like to enhance it so that before each actual character is printed, a random character flickers in place. This would simulate a “hacking / sci-fi terminal” effect.
Here’s the basic code I started from (from an old Stack Overflow post):
Code: Select all
@echo off
:: Ghost typer
setlocal enableextensions enabledelayedexpansion
set lines=6
set "line1=Twinkle twinkle little star"
set "line2=How I wonder what you are"
set "line3=Up above the world so high"
set "line4=Like a diamond in the sky"
set "line5=Twinkle twinkle little star"
set "line6=How I wonder what you are"
for /f %%a in ('"prompt $H&for %%b in (1) do rem"') do set "BS=%%a"
for /L %%a in (1,1,%lines%) do set num=0&set "line=!line%%a!"&call :type
pause>nul
goto :EOF
:type
set "letter=!line:~%num%,1!"
if not "!letter!"=="" set /p "=a!BS!!letter!" <nul
set /a num+=1
goto :type
Specifically:
I want each letter to first briefly appear as a random character (chosen from A-Z, 0-9, and some symbols) and then be replaced by the correct letter.
Spaces between words should appear normally.
Timing should be adjustable for a cinematic typing effect.
Some how I manged to do exactly what I wanted some years ago. But sadly ive lost the code

Has anyone successfully implemented something like this in pure batch? Any guidance or example code would be greatly appreciated.
Thanks in advance
