Custom Errors

A 5 minute guide.

  ninjas.digital GUIDE!


 

 How to make your very own custom error message.

 

TRY IT!

 

 

Error Hal 9000

1. right-click desktop W T (new )
2. ENTER ENTER (open )
3. Paste the code. (see below)
4. Alt F A (save-as )
5. Type: filename.vbs ENTER

.vbs
save with a .vbs extension

The Code

Error Sample

ninjas=msgbox("My custom error message.", 0+16 , "My error title.")

Open the new file to see the above error.

Options

After entering your own error title and error message you can change the error icon and button choices by editing 0+16:

FIRST VALUESECOND VALUE
0 =OK16 =Warning Message Icon
1 =OK Cancel32 =Warning Query Icon
2 =Abort Retry Ignore48 =Critical Message Icon
3 =Yes No Cancel64 =Information Message Icon
4 =Yes Nox =none
5 =Retry Cancel
Error Wine Instead
This example uses 4+32.

Adding Line Breaks

Error Hal 9000

To start a new line in your error message use & vbCrLf & for a line break then quotes containing the text for the next line. Use "" for a blank line.
 
ninjas=msgbox("I'm sorry, Dave." & vbCrLf & "I'm afraid I can't do that." & vbCrLf & "" & vbCrLf & "I think you know what" & vbCrLf & "the problem is just as" & vbCrLf & "well as I do.", 5+48 , "ninjas.digital - HAL 9000")

An example using line breaks.

Stacked Error Windows

Error Error

To let Windows stack multiple error windows simply open the same file twice without clicking a button or closing a window.
 

Two separate error files run back-to-back.

Posted

in

by

Tags: