This tutorial shows how to play a fake error message (VBScript) in Windows using the 'Notepad' program.
Steps
![OpenNotepad Step 1 1 OpenNotepad Step 1 1](https://i.sundulerparents.com/images/005/image-13687-1-j.webp)
Step 1. Launch Notepad
Press the hotkey combination 'Windows + R', then type the command 'notepad.exe' in the 'Open' field of the 'Run' window.
![Type Step 2 1 Type Step 2 1](https://i.sundulerparents.com/images/005/image-13687-2-j.webp)
Step 2. Inside the Notepad window, copy and paste the following code:
'x = Msgbox ("[Message body]", 4 + 16, "[Title of popup window]")' (without quotes). Another code example that displays a popup window with 'Yes' and' No 'buttons is as follows:' onclick = msgbox ("[Message body]", 20, "[Title of popup window]") '(without quotes).
![ChangeMessage Step 3 ChangeMessage Step 3](https://i.sundulerparents.com/images/005/image-13687-3-j.webp)
Step 3. Replace the strings [Message Body] and [Popup Window Title] respectively with the error message you want to display and with the title that will be assigned to the popup window containing the error message
Change the code '4 + 16' to a different combination of values, they are listed in the 'Tips' section. This way you will manage the type of window and the number of buttons displayed.
![SaveAs Step 4 SaveAs Step 4](https://i.sundulerparents.com/images/005/image-13687-4-j.webp)
Step 4. Go to the 'File' menu and select the 'Save' item
Type in the name you want to give your file and add the '.vbs' extension.
![OpenVBS Step 5 OpenVBS Step 5](https://i.sundulerparents.com/images/005/image-13687-5-j.webp)
Step 5. Double click your VBS file to display your error message
Advice
-
To change the icon associated with the popup window, use the following codes:
- 16 - critical error icon
- 32 - question mark icon
- 48 - attention message icon
- 64 - information message icon
- To change the buttons on the pop-up window, use one of the following codes:
- 0 - Display 'OK' button only
- 1 - Display the 'OK' and 'Cancel' buttons
- 2 - Displays the 'Ignore', 'Retry' and 'Cancel' buttons
- 3 - Display the 'Yes', 'No' and 'Cancel' buttons
- 4 - Display the 'Yes' and 'No' buttons
- 5 - Display the 'Retry' and 'Cancel' buttons