Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for whois.bat

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

  1. @ECHO OFF
  2. ECHO.
  3.  
  4. :: Windows and OS/2 only
  5. SET OS_OK=0
  6. VER | FIND /I "Windows" >NUL
  7. IF NOT ERRORLEVEL 1 SET OS_OK=1
  8. VER | FIND /I "OS/2" >NUL
  9. IF NOT ERRORLEVEL 1 SET OS_OK=1
  10. VER | FIND /I "eCS" >NUL
  11. IF NOT ERRORLEVEL 1 SET OS_OK=1
  12. IF %OS_OK%==0 GOTO Syntax
  13.  
  14. :: Check command line parameter
  15. IF [%1]==[] GOTO Syntax
  16. ECHO.%1 | FIND "?" >NUL
  17. IF NOT ERRORLEVEL 1 GOTO Syntax
  18. SET Dom_OK=0
  19. ECHO.%1 | FIND /I ".com" >NUL
  20. IF NOT ERRORLEVEL 1 SET Dom_OK=1
  21. ECHO.%1 | FIND /I ".net" >NUL
  22. IF NOT ERRORLEVEL 1 SET Dom_OK=1
  23. ECHO.%1 | FIND /I ".org" >NUL
  24. IF NOT ERRORLEVEL 1 SET Dom_OK=1
  25. IF %Dom_OK%==0 GOTO Syntax
  26.  
  27. :: NT and OS/2 should enclose the URL in quotes
  28. ECHO.%COMSPEC% | FIND /I "CMD.EXE" >NUL
  29. IF NOT ERRORLEVEL 1 GOTO NT_OS2
  30.  
  31. START "http://www.netsol.com/cgi-bin/whois/whois?STRING=%1&SearchType=do&STRING2.x=40&STRING2.y=15"
  32. GOTO End
  33.  
  34. :NT_OS2
  35. START "WhoIs" "http://www.netsol.com/cgi-bin/whois/whois?STRING=%1&SearchType=do&STRING2.x=40&STRING2.y=15"
  36. GOTO End
  37.  
  38. :Syntax
  39. ECHO WHOIS,  Version 2.00 for Win32 and OS/2
  40. ECHO Show WHOIS database entry for the specified domain.
  41. ECHO.
  42. ECHO Usage:  WHOIS  domainname.tld
  43. ECHO Where:  domainname.tld can be any valid .COM, .NET or .ORG domain
  44. ECHO.
  45. ECHO Note:   Rename this batch file to *.CMD to use it in OS/2
  46. ECHO.
  47. ECHO Written by Rob van der Woude
  48. ECHO http://www.robvanderwoude.com
  49.  
  50. :End
  51. SET OS_OK=
  52. SET Dom_OK=
  53.  

page last modified: 2024-04-16; loaded in 0.0066 seconds