Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for whois.vbs

(view source code of whois.vbs as plain text)

  1. ' Check number of command line parameters
  2. If WScript.Arguments.Count <> 1 Then Syntax
  3.  
  4. strUrl = WScript.Arguments(0)
  5.  
  6. ' Check if command line parameter could be a valid URL for our WhoIs search
  7. chk = Left( strUrl, 2 )
  8. If InStr( chk, "." ) > 0 Then Syntax
  9. tld = Lcase( Right( strUrl, 4 ) )
  10. If tld <> ".com" AND tld <> ".net" AND tld <> ".org" Then Syntax
  11.  
  12. ' Build search string for specified domain name
  13. strSearch = "http://www.netsol.com/cgi-bin/whois/whois?STRING=" _
  14.           & strUrl & "&SearchType=do&STRING2.x=40&STRING2.y=15"
  15.  
  16. ' Use default browser to retrieve info from Network Solutions' website
  17. CreateObject( "WScript.Shell" ).Run strSearch
  18.  
  19. ' Done
  20. WScript.Quit 0
  21.  
  22.  
  23. Sub Syntax
  24. 	strMsg = vbCrLf & "WhoIs.vbs,  Version 3.00" & vbCrLf _
  25. 	       & "Display WHOIS database entry for the specified domain name" _
  26. 	       & vbCrLf & vbCrLf _
  27. 	       & "Usage:  CSCRIPT  WHOIS.VBS  domain_name" _
  28. 	       & vbCrLf & vbCrLf _
  29. 	       & "Where:  " & Chr(34) & "domain_name" & Chr(34) & " is the " _
  30. 	       & "domain name (.com, .org or .net only)" & vbCrLf _
  31. 	       & "                      to look up (just the domain name, " _
  32. 	       & "no http://)" & vbCrLf & vbCrLf _
  33. 	       & "Written by Rob van der Woude" & vbCrLf _
  34. 	       & "http://www.robvanderwoude.com" & vbCrLf
  35. 	WScript.Echo strMsg
  36. 	WScript.Quit 1
  37. End Sub
  38.  

page last modified: 2024-02-26; loaded in 0.0238 seconds