How to create antivirus using batch programming

In this tutorial we will learn how to create our own antivirus program to detect an delete any virus we fed up in our Antivirus Database.As we all know Antivirus are actually programs which have potential to detect wide range of dangerous programs also know as virus.Remember this is an example lab showing basics of antivirus program and which makes you able to learn how to code antivirus to detect a specific virus.So before you develop or design a antivirus program you must have database of viruses.The more databases you have the more powerful your antivirus will be.


Here in this tutorial we will manually create a virus and them put them inside a folder or drive and then we write an anitivirus program to detect that virus and delete them.

antivirus coding



STEP 1:First create a demo virus programe and name it satish.bat

Now using Notepad I am going to creat a FORK BOMB Virus which when run on any Windows Machine the Machine will get hang within 2 minutes.After running this Virus code you have to manually shutdown your system using physical Button because even shutdown command also not work and neither any other key or mouse.So if you want to test this virus you can test it on your windows PC but i will suggest you to test it inside your windows pc installed inside any Virtualization software like VirtualBox or Vmware.

-Now open Notepad and write the below online code.



-Now save the file as satish.bat



STEP 2:Now copy paste the satish.bat file inside C drive.


STEP 3:Now Iam going to write the Antivirus Program to detect the virus satish.bat and if find delete it.

-Open again a new notepad and write the below code inside it and save it as Antivirus.bat.

@echo off
 title Virus Detection Tool By Satish Tiwary
 echo Detecting Viruses......

cd C:\
 IF EXIST satish.bat goto infected
 IF NOT EXIST virus.bat goto clean
 del satish.bat
 goto start
 echo your System is secure now and virus has been deleted!


STEP 4:Now go to your C drive and check whether your virus file satish.bat has been deleted by your antivirus program or not.

If you find any problem regarding the code you can ask here through comment section.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.