vbs 异常

On Error Resume Next
Err.Clear
Set myObj = CreateObject("SomeKindOfClassThatDoesNotExist")
If Err.Number <> 0 Then
 WScript.Echo "Error: " & Err.Number
 WScript.Echo "Error (Hex): " & Hex(Err.Number)
 WScript.Echo "Source: " & Err.Source
 WScript.Echo "Description: " & Err.Description
 Err.Clear
End If
On Error Goto 0
WScript.Echo "This text will always print."

你可能感兴趣的:(vbs 异常)