I came to some VBScript examples, and I saw the statement On Error Resume Next
basically at the beginning of the script.
What does it do?
It's worth noting that even when On Error Resume Next
is in effect, the Err object is still populated when an error occurs, so you can still do C-style error handling.
On Error Resume Next
DangerousOperationThatCouldCauseErrors
If Err Then
WScript.StdErr.WriteLine "error " & Err.Number
WScript.Quit 1
End If
On Error GoTo 0