Whether you're an app developer or just someone wanting to prank their coworkers, knowing how to create a custom error message is an essential skill. It is very easy to learn how to create a Windows error message.
Steps
Method 1 of 2: Create a single error dialog box

Step 1. Open Notepad
Start the program Notepad.
- Simultaneously press ⊞ Win + R
- Type Notepad in the dialog box Execute.
- Press Enter or click OK.

Step 2. Enter the code
Copy and paste the following code into the Notepad:
x = msgbox ("Type your message here", button + icon, "Enter your title here")

Step 3. Customize the button (s)
To customize the buttons, replace button in the code you just pasted into the Notepad by one of the following codes:
- 0 - OK;
- 1 - OK and Cancel;
- 2 - Abandon, Restart and Ignore;
- 3 - Yes, No and Cancel;
- 4 - Yes and No;
- 5 - Start over and Cancel.

Step 4. Customize the icon
To customize the icon for your error message, replace icon in the code you just pasted into the Notepad by one of the following codes:
- 0 - no icon;
- 16 - the critical error icon (“X” icon);
- 32 - the question icon (“?” Icon);
- 48 - the warning icon (“!” Icon);
- 64 - the information icon (“i” icon).

Step 5. Personalize the title
To customize the title of your error message, replace Enter your title here in the code you pasted into the Notepad by the title you want to give your error message.

Step 6. Personalize the message
To customize the message of your error message, replace Type your message here in the code you pasted into the Notepad with the error message you want to display.

Step 7. Save the document
To open the window Save as, press Ctrl + S on your keyboard.

Step 8. Select the type of backup
Expand the list next to Type and select All the files (*.*).

Step 9. Name your file
Type a name for your file, followed by a period (.) and vbs.

Step 10. Choose a location
Choose a folder where to save your file.

Step 11. Save
Click the Save button.
Step 12. View the message
To view the error message, double-click on the file you just created.

Method 2 of 2: Create a sequence of error dialog boxes
Creating a sequence of error dialog boxes will cause error messages to be displayed one after the other. Each message will appear as the previous message has been closed.

Step 1. Open Notepad
Start the program Notepad.
- Simultaneously press ⊞ Win + R
- Type Notepad in the dialog box Execute.
- Press Enter or click OK.

Step 2. Enter the code
Copy and paste the following code into the Notepad:
x = msgbox ("Type your message here", button + icon, "Enter your title here")

Step 3. Customize the buttons
To customize the buttons, replace button in the code you pasted into the Notepad by one of the following codes:
- 0 - OK;
- 1 - OK and Cancel;
- 2 - Abandon, Restart and Ignore;
- 3 - Yes, No and Cancel;
- 4 - Yes and No;
- 5 - Start over and Cancel.

Step 4. Customize the icon
To customize the icon for your error message, replace icon in the code you pasted with one of the following codes:
- 0 - no icon;
- 16 - the critical error icon (“X” icon);
- 32 - the question icon (“?” Icon);
- 48 - the warning icon (“!” Icon);
- 64 - the information icon (“i” icon).

Step 5. Personalize the title
To customize the title of your error message, replace Enter your title here that you stuck in the Notepad by the title you want to give your error message.

Step 6. Personalize the message
To customize the message of your error message, replace Type your message here in the code you pasted into the Notepad with the error message you want to display.

Step 7. Add a line
Press Enter to go to the line.

Step 8. Create another message
Write another error message (if you want). Repeat the steps from step 3.
This message will appear after the previous message has been closed

Step 9. Save the document
To open the dialog box Save as, press Ctrl + S on your keyboard.

Step 10. Select the type of backup
Expand the list next to Type and select All the files (*.*).

Step 11. Name your file
Give your file a name, followed by a period (.) and vbs.

Step 12. Choose a location
Choose a folder to save your file to.

Step 13. Save
Click the Save button.
Step 14. View the messages
To start the sequence of error messages, double-click on the file you just created.