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 fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 601,598 times.
Learn more...
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.
Steps
Creating a Batch File in Command Prompt
-
Open a new Notepad document. You can create a simple Matrix digital rain effect in Command Prompt with just a few simple lines of code.
-
Paste the following code into the Notepad document. 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 -
Save the file. 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).
-
Run the batch file as an administrator. To do this, navigate to the batch file and right-click it, then click Run as administrator.
-
5Press 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.
-
Type Ctrl+C and type "y" to terminate the program. Press ↵ Enter and the window will close.
Using a PowerShell Script
-
1Download 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.
-
2Open 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.
-
3Update 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."
-
4Navigate 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).
- To learn how to use the change directory (cd) command, check out our CD command guide.
-
5Run 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.
Community Q&A
-
QuestionI created the .bat file, but I want to open from cmd. How can I do that?
Community AnswerIf 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. -
QuestionCan this be done in Windows 7?
Community AnswerAs long as you have a notepad or a similar application terminal or command prompt. -
QuestionI'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 AnswerTry modifying your script to this: title MATRIX echo off cls :start echo %random% %random% %random% %random% %random% %random% %random% %random% goto start





