wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 54 people, some anonymous, worked to edit and improve it over time.
The wikiHow Tech Team also followed the article's instructions and verified that they work.
This article has been viewed 639,205 times.
Learn more...
Do you want to create a custom Windows error message? Whether you're an application developer or someone who wants to prank their coworker, knowing how to create a custom error message is an essential ability. To learn how to create a custom Windows error message, follow this guide.
Steps
-
Open the Notepad app.[1]
- Press the ⊞ Win+R keys simultaneously.
- Type notepad into the Run dialog.
- Hit ↵ Enter or click OK.
-
Copy and paste the following code into Notepad:
- x=msgbox("Your Message Here", Button+Icon, "Your Title Here")
Advertisement -
Customize the button(s) of your error message. Replace Button in the code you pasted into Notepad with one of the following:
- 0 - OK
- 1 - OK and Cancel
- 2 - Abort, Retry and Ignore
- 3 - Yes, No and Cancel
- 4 - Yes and No
- 5 - Retry and Cancel
-
Customize the icon of your error message. Replace Icon in the code that you pasted into Notepad with one of the following:
- 0 = No Icon
- 16 = Critical Icon (a.k.a. "X" icon)
- 32 = Question Icon (a.k.a. "?" icon)
- 48 = Warning Icon (a.k.a. "!" icon)
- 64 = Info Icon (a.k.a. "i" icon)
-
Customize the title of your error message. Replace Your Title Here in the code you pasted into Notepad with what you want the title of the error message to be.
-
Customize the contents of your error message. Replace Your Message Here in the code you pasted into Notepad with what you want the error message to say.[2]
-
Open the Save As window. Press Ctrl+S on your keyboard.
-
Expand the combo box next to Save as type and select All Files.
-
Type a name for your file followed by a period and vbs.[3]
-
Choose a location to save the file to.
-
Save the file. Click Save.
-
Display the error message. Double-click the file that was created.
Create a sequence of error messages. Messages will display one at a time, and closing a message will display the following one.
-
Open the Notepad app.[4]
- Press the ⊞ Win+R keys simultaneously.
- Type notepad into the Run dialog.
- Hit ↵ Enter or click OK.
-
Copy and paste the following code into Notepad:
- x=msgbox("Your Message Here", Button+Icon, "Your Title Here")
-
Customize the button(s) of your error message. Replace Button in the code you pasted into Notepad with one of the following:[5]
- 0 - OK
- 1 - OK and Cancel
- 2 - Abort, Retry and Ignore
- 3 - Yes, No and Cancel
- 4 - Yes and No
- 5 - Retry and Cancel
-
Customize the icon of your error message. Replace Icon in the code that you pasted into Notepad with one of the following:
- 0 - No Icon
- 16 - Critical Icon (a.k.a. "❌" icon)
- 32 - Question Icon (a.k.a. "❓" icon)
- 48 - Warning Icon (a.k.a. "❗" icon)
- 64 - Info Icon (a.k.a. "ℹ️" icon)
-
Customize the title of your error message. Replace Your Title Here in the code you pasted into Notepad with what you want the title of the error message to be.
-
Customize the contents of your error message. Replace Your Message Here in the code you pasted into Notepad with what you want the error message to say.
-
Switch to a subsequent line position.
-
Create another error message (if desired). Repeat these steps, starting from Step 3.
- This error message will display after the previously created one has been closed.
-
Open the Save As window. Press Ctrl+S on your keyboard.
-
Expand the combo box next to Save as type and select All Files.
-
Type a name for your file followed by a period and vbs.[6]
-
Choose a location to save the file to.
-
Save the file. Click Save.
-
Display the error message. Double-click the file that was created.
Community Q&A
-
QuestionIs there a way to make a custom icon for the error?Community AnswerNo, you can try using different numbers, but most likely a real error will pop up.
-
QuestionHow do I make it do actions to my computer?Community AnswerYou can't do that. It's a fake error, meaning it won't do anything to your computer.
-
QuestionHow do I create an input text box in the message?Community AnswerDo this: InputVariableName=InputBox("Prompt","Title","Value which is optional")
Video
Tips
Tips from our Readers
- Put +4096 after the icon number. Then you'll get a system modal (all apps will stop working until you respond).
- To go to the next line, use +vbnewline+.
References
- ↑ https://support.microsoft.com/en-us/windows/help-in-notepad-4d68c388-2ff2-0e7f-b706-35fb2ab88a8c
- ↑ https://www.youtube.com/watch?v=tunlgnEcGqk&t=39s
- ↑ https://youtu.be/cuD_aprDz9M?t=79
- ↑ https://support.microsoft.com/en-us/windows/help-in-notepad-4d68c388-2ff2-0e7f-b706-35fb2ab88a8c
- ↑ https://youtu.be/tunlgnEcGqk?t=52
- ↑ https://youtu.be/tunlgnEcGqk?t=80