PDF download Download Article
Create a Matrix-style rain effect using a Command Prompt batch file
PDF download Download Article

Do you want to make a cool Matrix-style digital rain effect in Command Prompt? You can, and thankfully, it's really easy! In this article, we go over how you can write your own batch file to create a digital rain effect in Command Prompt, and we also teach you how to use a PowerShell script from GitHub to make a more advanced digital rain effect. Read on to learn more!

Creating the Matrix Digital Rain in CMD

To create the digital rain effect in Command Prompt, create a batch file that constantly creates random numbers that fill up the screen. You can also download a PowerShell script from GitHub that will create a realistic Matrix digital rain animation in PowerShell, another Windows CLI.

Section 1 of 2:

Creating a Batch File in Command Prompt

PDF download Download Article
  1. You can create a simple Matrix digital rain effect in Command Prompt with just a few simple lines of code.
  2. Highlight all of the code, press Ctrl+C, then paste it into your Notepad file by pressing Ctrl+V.
    @echo off
    color A
    :start 
    echo %random%%random%%random%%random%%random%%random%%random%%random%
    timeout /t 0 /nobreak > nul
    goto :start
    
    • Add more "%random%" to the fourth line to make the text fill up the width of the Command Prompt window, if you prefer.
    Advertisement
  3. Click File > Save As…, then choose a folder on your computer to save it to. Name the file whatever you want, but add a ".bat" to the end of the filename to make it a batch file.
    • For example, if you wanted to name the file "Matrix," you'd save it as "Matrix.bat" (without quotation marks).
  4. To do this, navigate to the batch file and right-click it, then click Run as administrator.
  5. 5
    Press the maximize button to make the Command Prompt window fill your screen. To really make this look like the Matrix, click the button in the upper-right corner that looks like a square. This will make the Command Prompt window fill the entire screen.
  6. Press Enter and the window will close.
  7. Advertisement
Section 2 of 2:

Using a PowerShell Script

PDF download Download Article
  1. 1
    Download the Matrix animation repository from GitHub. If you want a more realistic digital rain effect in your command line interface, download the Pwsh Matrix Animation project by avdaredevil on GitHub.
    • To download the repository, go to the Pwsh Matrix Animation page on GitHub. You don't need a GitHub account to do this.
    • Click the green Code button to open a drop-down.
    • Click Download ZIP.
    • Unzip the zipped file once it's done downloading.
  2. 2
    Open PowerShell as an administrator. You can do this by searching "powershell" in the search bar, then right-clicking it and choosing Run as administrator.
    • This script will only work in Windows PowerShell, not Command Prompt. PowerShell is another command-line interface available on modern Windows operating systems.
  3. 3
    Update your Execution Policy. To run scripts from the internet, you must change the Execution Policy in PowerShell. To do this, run the command Set-ExecutionPolicy -Scope CurrentUser Unrestricted and type "Y" to confirm.[1]
    • Only run scripts you trust in PowerShell. Once you're done with the Matrix script, make sure to change your Execution Policy back to "Restricted."
  4. 4
    Navigate to the directory that holds the Matrix.ps1 file. For example, if the Matrix.ps1 file is in your Downloads folder on your C drive, you'd enter the command cd C:\Users\[username]\Downloads (where [username] is your Windows username).
  5. 5
    Run the command. To do so, type .\Matrix.ps1 and press Enter. You'll be prompted to confirm if you want to run the script. Press "R" to continue.
    • The animation will now play in your PowerShell window! To make it as big as your screen, click the Maximize button in the upper-right corner (the icon of the square).
    • You can also add parameters to your .\Matrix.ps1 command. For the best experience, use the command .\Matrix.ps1 -SpecialChars -Sparsity 1 -Renderer Windows.
      • For all the parameters you can use, go to the Pwsh Matrix Animation GitHub page.
  6. Advertisement

Community Q&A

Search
Add New Question
  • Question
    I created the .bat file, but I want to open from cmd. How can I do that?
    Community Answer
    Community Answer
    If you have clicked it and it has not opened itself, then save it again and name it. At the end of the name put .bat and then try.
  • Question
    Can this be done in Windows 7?
    Community Answer
    Community Answer
    As long as you have a notepad or a similar application terminal or command prompt.
  • Question
    I've created my matrix batch file, but the cmd opens for just two-thirds of a second, and then the cmd closes. How can I fix this?
    Community Answer
    Community Answer
    Try modifying your script to this: title MATRIX echo off cls :start echo %random% %random% %random% %random% %random% %random% %random% %random% goto start
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement
Did this article help you? Say thanks with a small tip.
icon
$1
$3
$5
Leave a Tip
Support our mission to help everyone in the world learn how to do anything.

Video

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Create a 'Matrix' Falling Code Batch FileCreate a 'Matrix' Falling Code Batch File
Make a Scary Batch File for Command Prompt Crash a Computer with a Scary Batch File
Make a Video Game With CmdMake a Video Game With Cmd
Build a Simple Computer Game Using Batch ScriptBuild a Simple Computer Game Using Batch Script
Crash Your Computer Using a Batch File Crash Your Computer Using a Batch File: A Step-by-Step Guide
Make It Look Like You Are Hacking Make It Look Like You are Hacking
Make a Program Using NotepadMake a Program Using Notepad
Make a Game with Notepad3 Cool Ways to Make Your Own Game with Notepad
Write a Batch FileWrite a Batch File
Create Options or Choices in a Batch FileCreate Options or Choices in a Batch File
Make an Easy E Bomb Using NotepadMake an Easy E Bomb Using Notepad
Make CMD BeepMake CMD Beep
Change Colours in Command Prompt Change Colours in Windows Command Prompt
Use CMD (Beginner) Use CMD Command Lines as a Beginner
Advertisement

About This Article

Hannah Dillon
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Hannah Dillon. Hannah Dillon is a Technology Writer and Editor at wikiHow. She graduated with a B.A. in Journalism from North Dakota State University in 2013 and has since worked in the video game industry as well as a few newspapers. From a young age Hannah has cultivated a love for writing and technology, and hopes to use these passions in tandem to help others in the articles she writes for wikiHow. This article has been viewed 601,598 times.
How helpful is this?
Co-authors: 50
Updated: December 16, 2025
Views: 601,598
Categories: Command Prompt
Thanks to all authors for creating a page that has been read 601,598 times.

Is this article up to date?

Advertisement