Instructables

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!
 
Remove these adsRemove these ads by Signing Up

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.
admin6 years ago
Hey, this is a great instructable and is very informative. Just one thing is missing... pictures! It really helps a lot when trying to follow directions so you should consider taking some photographs. Once you do that and leave me a message when you have so that we can publish your work. Thanks! Thanks for the cool instructable and we hope to publish this soon!
admin6 years ago
Hello, and welcome to the Instructables community! It's great that you've decided to tell the world about something you've made by publishing an Instructable. We just wanted to let you know that your project still needs a little more work if you want it to be well received on Instructables. Projects that don't include certain basic elements tend not to get the attention that they deserve, and so we'd love for you to check out the list below of what makes a successful Instructable. Successful projects on Instructables include: - clearly written details of a finished project with instruction - as many steps as are necessary to explain your project - clear images that you took of your project for most, if not all of your steps - an intro image - proper spelling and grammar - appropriate cautions or safety considerations I'll give you another opportunity to make any final changes to your project before we publish it. Once you're all set to go, please republish your project and send me a quick comment letting me know that you've made some changes. I'll give it a quick final check to make sure you're on the right path, and then remove this note. Thanks for your submission and we hope to see your project published soon!
habibieboy7 days ago

Hi there.... i wanna ask, how could I change the dialog box's icon on the taskbar? So it's more fun if i can do that.

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”

sonicmario1 year ago
i have made one but it doesn't work it is in dutch so you may not understand it.
here it is:
x=msgbox ("klik op yes", 4,"wees verstandig")
if x=6 then
msgbox "goed zo", 0,":)"
msgbox "kijk jij bent slim"
want er zijn ook mensen die op nee klikken en die krijgen nog een lang verhaal hierachter aan.", 0,"druk op ok"
elseif x=7 then
msgbox "waarom klik je toch op no?", 0,">|"
msgbox "ik zei dat je op yes moest klikken en toch doe je het niet."
msgbox "ik ga je de vraag nog eens stellen. (het is geen vraag maar toch. jij klikt op no :p)", 0,"klik op ok"
msgbox "klik op yes", 4,"wees verstandig"
if x=6 then
msgbox "goed zo", 0,":)"
msgbox "nee grapje. dat zou te gemakkelijk zijn", 0,"lol"
msg* suc6 ermee
goto 12345
elsif x=7 then
msgbox "serieus doe je het alweer.", 0,"jij zit in de problemen."
msgbox "klik maar op ok dan ben je er vanaf.", 0,"doei"
end if

type it (or just copy it) in your notepad and please fix the problems. but only if you want to
you can mail me @
nando.kools@live.nl
jcdwalle1 year ago
I can't download. Help?
scano11 year ago
Hello i'm planning to make a .vbs on notepad itembox popup then enter choices a, b, c ,d and the value of letter i inserted is

a=1

b=2

c=3

d=4

then when i type "a"on first itembox and hit enter there will be another popup itembox with the same choices example i choose "b"

when i hit enter the total of first and second itembox will be computed and write on registry NoDriveTypeAutoRun dword value

on this registry

Before script run:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

"NoDriveTypeAutoRun"=dword:00000000

After script run:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

"NoDriveTypeAutoRun"=dword:00000003




can you give me code for the .vbs or .vbe or .hta using notepad please[:'(]
Barondando5 years ago
I just finished an application in C#, I used this tutorial for the notepad coding, my app will generate the code for you, all you have to do is type in what you want the header to say, what you want the message to say, and select the style of message box from a drop down list. You can then save it, and it disallows users to save as any filetype other than .vbs
please post application!
I don't know where or how to upload it...
I use mediafire.com

Hope that helped ya ;D
Ok here is the program I made.. It does everything that is included in this tutorial plus Loops and it is very easy to use.

Download Link -

fictionmaze.com/Downloads/Textboxgen.exe
That is awesome! Could you tell me how to do that?
Hey i'm new to all of this and i was wondering if you can put a shutdown timer (like you can with batch files) at the end
jparker292 years ago
I'm going to send this to my friend!!! LOL
ajosué2 years ago
You can just put:

msgbox "text" , number, "title"

and save it with the extension .vbs
neivadan2 years ago
say ahhh what in the world are we suppoesd to save this message box as because it dosent even say in the instrutables but anywhy it's a good thing ye posted how to make thoguh !!)
QwertyuioLP5 years ago
if you want infinite msg boxs you can add

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

or

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

which ever one works for you
isnt it:
:LOOP
'your command'
GOTO LOOP


not to say your way is wrong i was just curious
It's the same.
And if you have more then one button and you want a specific button to loop it do this
x=msgbox("box text,buttons,box title")
do while(answer<>digit 1-10)
x=msgbox("bot text,buttons,box title")
loop.
Here's a real example
answer=msgbox("Loop?",36,"loop?")
do while(answer<>6)
x=msgbox("LOOP",msg,"LOOP")
loop
That will only loop if you press no. Don't use it if you don't know how end it.(just restart your computer)
millsasbc3 years ago
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 millsasbc@gmail.com
thanks
no no no this is how to make a msgbox in visual basic
not notepad
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
aakarsh19974 years ago
Nice one
prank or real?
mikemmcmeans: this is not visual basic, its visual basic script, there's a difference.  VBS is uncompiled and interpreted on the fly, whereas an app made in VB is compiled and not editable.
lolcat3605 years ago
i made one where you click on it and your computer starts being mean and tells you to take the disc out
its here
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
colCDROMs.Item(i).Eject
Next ' cdrom
End If
Great it works
it no work!!!
if you go into all programs and put it into folder: startup lots of timesit will show when you login about 100 times
TheGenius5 years ago
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 : samer_genius@hotmail.com