xp-consoles/console.vbs

28 lines
823 B
Plaintext

Option Explicit
On Error Resume Next
Sub VBSExecute(code)
Err.Clear
Execute "On Error Resume Next" & vbCrLf & code
If Err.Number <> 0 Then
console.error "VBScript Error " & Err.Number & " - " & Err.Source & ": " & Err.Description
End If
End Sub
Function VBSEval(code)
Err.Clear
VBSEval = Eval(code)
If Err.Number <> 0 Then
console.error "VBScript Error " & Err.Number & " - " & Err.Source & ": " & Err.Description
End If
End Function
'Auto-detect the wizard's browser extensions
Function InWebWizard()
InWebWizard = TypeName(window.external) = "INewWDEvents"
End Function
'Auto-detect the Windows Vista/7 sidebar gadget extensions
Function InGadget()
InGadget = TypeName(window.System) = "DispSystem" And TypeName(window.System.Gadget) = "DispGadget"
End Function