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.

Method 1
Method 1 of 2:

Single Error Dialog

  1. 1
    Open the Notepad app.
    • Press the Win+R keys simultaneously.
    • Type notepad into the Run dialog.
    • Hit Enter or click OK.
  2. 2
    Copy and paste the following code into Notepad:
    • x=msgbox("Your Message Here", Button+Icon, "Your Title Here")
    Advertisement
  3. 3
    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
  4. 4
    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)
  5. 5
    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.
  6. 6
    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.
  7. 7
    Open the Save As window. Press Ctrl+S on your keyboard.
  8. 8
    Expand the combo box next to Save as type and select All Files.
  9. 9
    Type a name for your file followed by a period and vbs.
  10. 10
    Choose a location to save the file to.
  11. 11
    Save the file. Click Save.
  12. 12
  13. Advertisement
Method 2
Method 2 of 2:

Sequence of Error Dialogs

Create a sequence of error messages. Messages will display one at a time, and closing a message will display the following one.

  1. 1
    Open the Notepad app.
    • Press the Win+R keys simultaneously.
    • Type notepad into the Run dialog.
    • Hit Enter or click OK.
  2. 2
    Copy and paste the following code into Notepad:
    • x=msgbox("Your Message Here", Button+Icon, "Your Title Here")
  3. 3
    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
  4. 4
    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)
  5. 5
    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.
  6. 6
    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.
  7. 7
    Switch to a subsequent line position.
  8. 8
    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.
  9. 9
    Open the Save As window. Press Ctrl+S on your keyboard.
  10. 10
    Expand the combo box next to Save as type and select All Files.
  11. 11
    Type a name for your file followed by a period and vbs.
  12. 12
    Choose a location to save the file to.
  13. 13
    Save the file. Click Save.
  14. 14
  15. Advertisement

Community Q&A

  • Question
    Is there a way to make a custom icon for the error?
    Community Answer
    Community Answer
    No, you can try using different numbers, but most likely a real error will pop up.
  • Question
    How do I make it do actions to my computer?
    Community Answer
    Community Answer
    You can't do that. It's a fake error, meaning it won't do anything to your computer.
  • Question
    How do I create an input text box in the message?
    Community Answer
    Community Answer
    Do this: InputVariableName=InputBox("Prompt","Title","Value which is optional")
Advertisement

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 52 people, some anonymous, worked to edit and improve it over time. This article has been viewed 542,773 times.
723 votes - 77%
Co-authors: 52
Updated: January 28, 2023
Views: 542,773
Categories: Computer Pranks
Advertisement