(view source code of whoiscom.vbs as plain text)
Option Explicit
Dim objFSO, objWhois, strWSC
On Error Resume Next
' First let's see if the component is registered
Set objWhois = CreateObject( "robvanderwoude.Whois.2" )
If Err Then
' If not, check if it exists in the current directory
' and use an alternative method to reference the component
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
With objFSO
MsgBox .GetParentFolderName( WScript.ScriptFullName )
strWSC = .BuildPath( .GetParentFolderName( WScript.ScriptFullName ), "Whois.wsc" )
If .FileExists( strWSC ) Then
strWSC = "script:" & strWSC
Set objWhois = GetObject( strWSC )
Else
WScript.Echo "Whois.wsc not registered, " _
& "nor found in current directory"
End If
End With
Set objFSO = Nothing
End If
On Error Goto 0
' Abort if we couldn't instantiate the object
If Not IsObject( objWhois ) Then WScript.Quit
' Set the required properties and query the Whois database
objWhois.DomainName = "youtube.com"
objWhois.ConnectTimeOut = 20
objWhois.Debug = False
objWhois.Query
' Display the results
WScript.Echo "Debug Status : " & objWhois.Debug
WScript.Echo "Domain Name : " & objWhois.DomainName
If objWhois.ErrorNumber Then
WScript.Echo "Error Number : " & objWhois.ErrorNumber
WScript.Echo "Error Source : " & objWhois.ErrorSource
WScript.Echo "Error Description : " & objWhois.ErrorDescription
Else
WScript.Echo "Registrar : " & objWhois.Registrar
WScript.Echo "Whois Server : " & objWhois.WhoisServer
WScript.Echo "Referral URL : " & objWhois.ReferralURL
WScript.Echo "Name Servers : " & objWhois.NameServers
WScript.Echo "Status : " & objWhois.Status
WScript.Echo "Creation Date : " & objWhois.CreationDate
WScript.Echo "Last Updated : " & objWhois.DateUpdated
WScript.Echo "Expiration Date : " & objWhois.ExpirationDate
End If
' Release the object
Set objWhois = Nothing
page last modified: 2024-04-16; loaded in 0.0099 seconds