How to get a matrix effect on cmd (command prompt).

Zaid
2 min readNov 17, 2022

Today we will be making our own batch script to achieve a matrix effect on our cmd.

What is a batch script ?

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file.

This is how a batch file or batch script is defined on wikipedia, for more info you can search it on the internet.

So coming back on our topic for today, matrix effect. Let’s start writing our batch script. We will be writing our script in notepad, just because it’s a common text editor easily available. You can write it in MS Word too if you wish or any text editor of your choice.

Writing our batch script

  1. First line of our script will be
@echo off

This will suppress the echo and execute the command without showing it on the command line.

2. Secondly we will change the color of the text of our cmd.

color A

This will change the color of text from white to bright green

3. Then we will use a backward goto statement to unconditionally loop our %Random% which we will echo on our cmd. %Random% will give us a random number each time we echo it.

 :start
echo %Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%
goto start

We are done. Yes it was this easy.

@echo off
color A
:start
echo %Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%%Random%
goto start

But wait wait wait……… this is not it. A very important step is saving our batch file.

We save a batch file with a .bat extention. Its file type needs to be set to All Files and Encoding to ANSI.

Look at the screenshot below and make sure you do everything correctly.

How to save a batch file

And now we can say we are good to go. Save this bad boy and lets execute it in our command prompt.

To execute it just go to the place where you saved your .bat file and double click it.

Matrix effect on cmd

Thankyou for reading till here. I hope you got your desired result. If you have any confusions, you can contact me @the_curiousfella .

--

--