Introduction: How to Make a Message Box in Notepad

Picture of How to Make a Message Box in Notepad

Hi there. I'm going to teach you how to make a message box. All you need is Notepad. If you have any comments, feel free to post them. Just start learning and have fun!

Step 1: Step 1: Typing the Text

Picture of Step 1: Typing the Text

First, open Notepad and type this:

x=msgbox(box text,buttons,box title)

On the part where it says "box text", type the text you want on the window (with quotation marks). On the "box title", type the title of the message box the same way you typed the text. On "buttons" type a number (without quotation marks):

0: Normal message box
1: OK and Cancel
2: Abort, Retry, Ignore
3: Yes, No, Cancel
4: Yes and No
5: Retry and Cancel
16: Critical message icon
32: Warning query icon
48: Warning message icon
64: Information message icon
4096: Always stay on top of the desktop

Step 2: Step 2: Saving the File

Picture of Step 2: Saving the File

When you're done, save it as a VBS(or VBScript)file. To do this, type ".vbs" at the end of the title and change the "Text Document (*txt)" in the "Save as type" select box to "All Files" .

Example: File name: Fake_Virus.vbs
Save as type: All Files

Step 3: The End

Picture of The End

Congratulations! You've done it. To have fun, why don't you make a message box disguised as a "fake" trojan horse on your friend's computer, create a shorcut, rename it, change the icon, lure your friend to click it, and watch them freak out!
As I said, feel free to post any comments.


millsasbc (author)2010-12-08

Hi could you please answer theese questions for me,
1. how do i make something happen when i click one of the buttons
2. how do i make the message box automatticaly open when i log on

thnaks could you please reply to this comment at

1. you cant

2. go to task scheduler and create a basic task, you'll get it from there

Yes, you can, you just have to make another message box just like the last one on a second line. But the other will appear even if you select the "X" Button.

VictorS10 (author)millsasbc2015-08-12

Well I know how to make it run when you log on to windows.

Here's how:

Open Start Menu >> Drag application to startup folder >> Enjoy!

mikemmcmeans (author)2009-06-20

no no no this is how to make a msgbox in visual basic
not notepad

u do it in notepad 1d1ot

Qajs1 (author)mikemmcmeans2010-10-17

Actually the way to make a MsgBox in Visual Studio is:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MsgBox("Computer Shutting down in 60 Minutes.")
End Sub

UmairY (author)2015-04-15

How can i create a never endind dailog box and it will display when computer start

create basic task in app: Task Scheduler with trigger of logon and action of run ur script

and also put your msg box code over and over for a long chain of msg boxes

Roberto_- (author)2015-12-20

what do i save it as?

It clearly states to save is as a .vbs file

BlazeN2 (author)Roberto_-2016-10-16

Save it as .vbs

kenneththewizard (author)2014-03-04

Hi! About a year ago I was looking at this... well it didn't
work when I tried it but I was quickly able
to discern a proper message box from what you had.

Here is what I did, no error message:

x=msgbox (“whatever you want message box to say here” ,0, ”title here”)
> “msgbox.vbs”

Keep trying normally. Windows needs to discern stuff after a ;ong time not using .vbs files.

Peekofwar5889 made it! (author)kenneththewizard2015-11-14

Microsoft VBScript compilation error:

Line: 1
Char: 11
Error: Invalid character
Code: 800A0408

hi there Peekofwar5889, just retype all the quotation marks. it should work.

jitske.hibma (author)2015-02-22

I, m sorry, did'nt get the point. This is what I saved as what was thought:

x=msgbox(box "mailbox",0,"veldfiets"), saved as .vbs, all type of files, in Documents.

Nothing happens on opening the .vbs file: not able to open etc. etc.

What is the clue here?

you have to save it as ".bat" that's why it did not work.

no you have to save it as .vbs

Wrong saving it as .bat is used in batch programming. Codes in batch is like @echo off

color 0a

title hello world


echo Hello World


vbscript would not run in batch so something is wrong with your method. Make sure your syntax is wright and save as whatyouwant.vbs but don't forget *.vbs. :)

Well, first there is an unknown tag: "bat" located in the parenthesis. If it is working properly, then this should at least pop up as an error, so I don't know why it is not working at all. This only runs on Windows (this could be it)

NickG9 (author)jitske.hibma2015-08-12

x=msgbox(box "mailbox",0,"veldfiets") is the wrong code. Try



whops. never mind. i had wrong

lolcat360 (author)2008-08-21

i made one where you click on it and your computer starts being mean and tells you to take the disc out

lolcat360 (author)lolcat3602008-08-21

its here

lolcat360 (author)lolcat3602008-08-21

answer=MsgBox("Hi, this is your computer.",0,"HI")
answer=MsgBox("I'm tired of you jamming discs into me.",0,"HI")
answer=MsgBox("Can you please take the disc out, like NOW???",0,"HI")
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
Next ' cdrom
End If

DYLEGO (author)lolcat3602008-11-05

it no work!!!

JeffersonL20 (author)DYLEGO2017-07-11

yes it does. just screenshot your problem with snipping tool and add it to your comment so the developing pros can help you solve it

MineblockRULEZ (author)lolcat3602015-12-05

I used the ejecting code to make a cool EJECT DISC button on my desktop!

Peekofwar5889 (author)lolcat3602015-11-13

HAHAA!!!!! Windows Defender thought this was a medium threat!!

wilson21 (author)lolcat3602009-04-06

Great it works

DarkG4 (author)2017-07-07

Please help.

JeffersonL20 (author)DarkG42017-07-11

check it. it says expected ')' so check if you left out any ')'s. in the picture, its missing a ) so that an example of how that mistake was made.

JeffersonL20 (author)DarkG42017-07-11

just retype the quotation marks

BlueberryB made it! (author)2017-06-27


KorbenW (author)2017-06-21

is there anyway you can make the message change colours repeatedly

CautionusSky45. made it! (author)2016-12-03

i did it it worked!

MayaS28 (author)2016-09-26

Doesn't work ;'(

GreyFascader (author)2016-06-19

you have to save it as either .bat or .vbs, im not sure but from the looks of it i'd say .vbs

SpitrayG (author)2016-01-18

This is going to be usefull. >:D

O-mer (author)2015-11-07


Is it possible to attach the message file to a program?

For example: when opening a program, the message that you created will pop-up and when you click ok it continues and runs the program...

Mr_ MikaS (author)2015-07-01

This is so cool, thanks for the instructable.
Could you make one for windows 8.1?

NickG9 (author)Mr_ MikaS2015-08-12

It is the same thing. Any computer that has Windows XP or higher will be able to make it.

Mr_ MikaS (author)NickG92015-08-12

Thank you very much.

meowk (author)2015-04-09

mines not a virus, its for making people welcome.

TheGenius (author)2008-12-30

NICEEE!!! i did it wiz my sis, she tought there was a virus!!!!!!! she started to cry ( btw i knew how to make this cz i am a pc n internet engeneer) if any help needed , add me at :

meowk (author)TheGenius2015-04-09

oh if u wana message me, here my email

GarrettM1 (author)2015-03-24


JacobH5 (author)2015-02-21

great job, do you think you could show how to do it on windows 8.1?

NickD5 (author)JacobH52015-03-13

The same EXACT way.

About This Instructable




Bio: I'm the left leg of the computer Ultimate but I have access to the web because there's a wire connecting me to the ... More »
More by 4_t477_guy:Display the BSoD with 3 keystrokesVista-lizing your old XP computer: the ultimate tutorialHow to make a message box in Notepad
Add instructable to: