Create a Computer Virus 💻 with just 3 Lines of Code [Harmless and Easy!]

Posted by Rohit Das on

Create a computer vrus with just 3 lines of code

Hi friends,

Today we will be making a really simple computer virus with just 3 lines of Code. And trust me, copying these code in a notepad will be much easier than to send HI to your crush on Whatsapp.

When I was in class 5, I was told that the word Virus stands for Vital Informational Resources Under Seige.
But in this example virus, we are not grabbing any vital information, rather we are making a very annoying computer virus that can be scary for some and funny for many. You can use this simple code to scare your friends, relative (those people who generally annoy us by asking about our results.) or your girlfriend.

Special Note:
This virus is not harmful, it is a small script that repeatedly do a certain task. Feel free to run it on your PC.
  • The language in which we are writing this script is - vb script
  • The code can run only in the windows environment (Windows PC).

  • But before starting I will love to invite you to my Whatsapp Broadcast Channel where I share Motivational quotes(1 per day), some article (2 per week) and Free Pdf of some of the most popular Books worth more than 100$.
  • If you want to join, save this mobile number
  • +91 9163513917 with name Rohit Das/
  • Whatsapp me your name as the First Message
  • Zero Spam Tolerance, Leave any Time,No hi/bye type stuff or chatting
    I won't make a group so your number will be with me only.

With that out of the way, Let's start those crazy stuff.

STEP 1: Creating the Document

To create a new Vb script document, go to any folder(directory) of your PC and Right Click. From that menu select New>Text Document.

Now you must see a new text doc in that folder. Select all the text from that box and replace it with some cool name but never forget to add ".vbs" extension at the end.

I am saving it as "priyanka_wp_number.vbs". I wanted to make fun of my friend, so I wrote his CRUSH's name + Whatsapp Number to make him click the file.

STEP 2: Writing the Code

For the sake of simplicity, I am writing very basic code(3 lines only). But you can always customize this code to get a more advanced virus.
What our code is supposed to do:
We are going to run a loop, where we will continuously show a prompt saying something weird. The loop will be of an infinite length and the user will have no way out. Some icons and button will make it look even dangerous.
Now open that vb script file in a notepad and copy paste this code

X = msgbox("System is about to delete all your Files", 0+48, "Serious System Threat : 330")

Save it and double click on that file.

Voila! now you have a beautiful virus prompt on your computer screen.

You can try clicking the button, but you will never be able to close that file.

Now we will be customizing the look of this virus,

You can notice, the 2nd line of our code has three parts:

Description: "System is about to delete all your Files",

Button+Icon: 0+48 and

Title: "Serious System Threat: 330"

You can write any thing in the Description and Title but we have fewer options for the buttons and icon.

To change the button, replace that 0 with any one of these - 1, 2, 3, 4 and 5.

To change the icon, replace that 48 with other options like - 16,32 or 64

How to stop this virus

At the very end, If you or friend gets frustrated, you may probably want to close this stuff. Follow these steps:
  • Step 1: Right Click on the Task Bar
  • Step 2: Select Task Manager
  • Step 3: Locate that Red Icon and right click on that, then select End Task.


Now, this is your turn, Hack this code and enjoy the joy of coding.

Hey, If you enjoyed reading this post, please help me out by sharing this post with your friends and followers on Whatsapp, Facebook and Twitter. You'll not only make my Day but my whole month!

Also, tell me in the comment section below how you're going to use this virus??

And if you saw some kind of Grammatical error / typos, Let me know in the comment section below


  1. Hey! This was a nice post!

    You broke down all the steps involved in creating a simple Computer Virus effectively.

    Sharing this!❤

  2. Really it is great plan about virus i appreciate you bro

    1. Thanks for your appreciations

  3. Really it is great plan about virus i appreciate you bro