loading
In this instructable, you will learn how to create a message box with notepad on your computer. Below is an example of a message box.

Step 1: Open Up Notepad

Open up notepad on your computer. Type in the following:

x=msgbox ("yourtexthere" ,0, "yourtitlehere")

Replace 'yourtexthere' with the words you want in your message box and replace 'yourtitlehere' with the title you want on your message box (for example x=msgbox ("Do you want to learn how to make this message box?" ,4, "Instructables").

Step 2: Editing Your Message Box

To choose the types of buttons or how you want your message box to look like change the number in between the commas.

x=msgbox ("Example Text" ,your number here, "Example Title")

Replace your number here with one of the following:

0 displays the OK button only
1 displays the OK and Cancel buttons
2 displays the Abort, Retry and Ignore buttons
3 displays the Yes, No, Cancel buttons
4 displays the Yes and No buttons
5 displays the Retry and Cancel buttons
16 displays the Critical Message icon
32 displays the Warning Query icon
48 displays the Warning Message icon
64 displays the Information Message icon
4096 is a system modal; all applications are suspended until the user responds to the message box (in other words, this message box stays on top of all applications)

Below is how the boxes will look like.

Step 3: Saving Your Message Box

Click File and Save As... and save it as yourfilename.vbs. Replace 'yourfilename' with the file name you want (for example instructables.vbs). The .vbs must be left at the end otherwise your message box wont work. Save it somewhere on your computer.

Step 4: Testing Your Message Box

Open up the file you saved.

There you have it! A message box created by you.

Step 5: Some Tips

If you want you can put more message boxes on your file.
for example:
x=msgbox ("Do you want to learn how to make this message box?" ,4, "Instructables")
x=msgbox ("If you said yes go to the Instructables website" ,0, "Instructables")
x=msgbox ("If you said no close the message box" ,0, "Instructables")

If you want your message box to be uncloseable (when you click a button or the close button the message box will keep on reappearing) type this:

do
x=msgbox ("yourtexthere" ,0, "yourtitlehere")
loop

The only way to stop this is to open up Windows Task Manager, go to the Processes tab and look for wscript.exe and click End Process.

<p>Is there a GOTO equivalent in VBScript?</p><p>For instance, I want to make a prank virus, &quot;SmartScreen&quot; says &quot;Do you want to delete?&quot; Yes or No. If the user presses &quot;no&quot;, it asks if sure, Yes or no. If yes, it goes back to the beginning as if the user pressed &quot;yes&quot; on the first dialog. If no the deletion cancels and the &quot;virus&quot; starts. But when on the &quot;delete&quot; route, it tries to delete, gives an error, says &quot;Try again?&quot; Retry or cancel. If cancel, the virus starts. If retry, it gives another error saying it &quot;couldn't start an instance of SMRTSCRN.SYS&quot;, then the virus starts anyway.</p><p>I know that sound like a lot of stuff, but I just didn't want to put in the actual code.</p>
<p>Thanks!</p>
<p>been interested here! also, how to insert timer on gui? set gui &quot;on&quot; by 10 minutes and if no answer or reply, set default reply as &quot;no&quot;. thanks a lot!</p>
Nice!<br/>But I know how to make it more advanced(who can work with visual basic is in advantage):<br/>First put on to the first line first (main) msessage box (that will decide what will happend next)<br/>Then put this:<br/><br/>If x=vb* Then<br/> x=messagebox(&quot;Second message box&quot;,any,&quot;any&quot;)<br/>End if<br/><br/>*Here you can put the name of the button that user was pressed (first letter must by big example: vbNo or vbIgnore...)<br/><br/>Here I create a cool example:<br/><br/>x=msgbox(&quot;Delete local disc D?&quot;,36,&quot;Disc cleaner&quot;)<br/>If x=vbNo Then<br/> x=msgbox(&quot;Really no?&quot;,36,&quot;Adjusting&quot;)<br/>If x=vbNo then<br/> x=msgbox(&quot;But you can't stop it.&quot;,64,&quot;Status&quot;)<br/>End if<br/>End if<br/>x=msgbox(&quot;Cleaning is starting.&quot;,64,&quot;Disc cleaner&quot;)<br/><br/>And how it work's:<br/>On start you have a &quot;main&quot; message saying: Delete local disc D?<br/>On second line computer is checking what you was press and if it was No you see next message with question: Really no?<br/>Then computer is again checking what you was press and if it was No you see message saing: But you can't stop it. and computer is going to last line<br/>If it wasn't No then computer jump on the last line where is next message box saing: Cleaning is starting.<br/>P.S. I think you can use this comment like next step :)<br/>
<p>Is there a way to make buttons that say custom things? For example, a message box that is yes or no, but says Always and Never.</p>
How do you make it so that if you select yes for example it will do one thing but then if you press no it will do another thing?<br />
<p>Type this:</p> <p>If x = vbNo Then</p> <p>*User press No</p> <p>Else</p> <p>***User&nbsp;doesn't press No&nbsp;- user press Yes or Ignore or OK or ...<br /> End If<br /> <br /> And if you want to react on more buttons (like when user can press Retry or Ignore or Abort) try this:<br /> <br /> If x = vbRetry Then<br /> *Retry<br /> ElseIf x = vbIgnore Then<br /> *Ignore<br /> ElseIf&nbsp;x = vbAbort Then<br /> *Abort<br /> Else<br /> *Not Retry, not Ignore, not Abort - something else<br /> End if</p>
'sweet I tryed that
What do you mean? Can you show me??
Wich part you mean? P.S. Try the example!
I TRYED ITS SO COOL I PRANKED MY MOM WHILE DOING THIS HERE IS AN EX:<br><br><br>x=msgbox(&quot;You Have A Virus&quot;,0,&quot;Virus&quot;)<br><br>Theres also another way follow ok<br><br><br>lol=msgbox(&quot;Message&quot;,0,&quot;Title&quot;)
4096 would be funneh<br />
I tried 'x=msgbox (&quot;All of your stuff toys have died due to underfeeding&quot;,4096,&quot;Alert!&quot;)'. When I opened Internet Explorer, it is still showing it!
<p>Oh, I get the 'system modal', example of it is like in Microsoft Office&nbsp;that you want to exit with unsave document and I tried to click some parts of the screen and it keeps beeping.</p>
<a href="http://www.miniclip.com/sketch-star/en/player.php?id=5150139">www.miniclip.com/sketch-star/en/player.php</a>
and I subscribed you
sweet and check this instructable out <a rel="nofollow" href="https://www.instructables.com/id/how-to-flip-your-text/">https://www.instructables.com/id/how-to-flip-your-text/</a><br/>
I have a code that can do something n times:<br/><br/>For i=1 to *<br/>**<br/>Next<br/><br/>*number of times<br/>**thing to do * times<br/>
How do you get it to open a program after?
Yes,<br/>here's the code:<br/><br/>set x=createobject(&quot;wscript.shell&quot;)<br/>x.run &quot;#&quot;<br/><br/>#Target to your file example: &quot;D:\test.bat&quot; or &quot;C:\test.vbs&quot;<br/>
is there a way to change the icon to Internet explorer or something like that?? thanks nasatara
There is a another way: right click on internet shortcut select properties and change target to your file
how do you make it go to things like note pad
This one is so cool, make a shortcut on the desktop and change the name and picture to the Internet explorer one. Its cool cause the victim thinks the problem is with the internet:<br/><br/>x=msgbox (&quot;Warning, Windows has found a virus. Do you want to remove it?&quot; ,4, &quot;WARNING!&quot;)<br/>x=msgbox (&quot;Windows could not remove virus. Searching for another antivirus software.&quot; ,0, &quot;WARNING!&quot;)<br/>x=msgbox (&quot;Windows has removed the virus. Virus deleted program 'Microsoft Word' before it was removed.&quot; ,0, &quot;WARNING!&quot;)<br/>
might want to check spelling before creating this. and make sure one of them says "FATAL ERROR. WIPE HARD DRIVE OR RISK DESTROYING COMPUTER."
lol put the 4096 one on it XD
?
4096 is a system modal; all applications are suspended until the user responds to the message box (in other words, this message box stays on top of all applications)
so, like, they can't just x out.<br/><br/>and it does the little *bum* noise and flashes when you try to go to another window.<br/>
yeah
This is all great and stuff, but there is no instructions on how to interface it. Is it really useful if "Do you want to open notepad?" pops up, but clicking the buttons does nothing?
Actually, this is useful for some real batches I wrote. Not just for idiotic 'pranking'.
Awesome! I make these all the time. They are great for pranking.

About This Instructable

64,734views

24favorites

License:

More by firtvid20:How to create an MP3 CD with iTunes Create a PDF How to create a message box? 
Add instructable to: