1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Batch Script + Firefox to preform whois lookup

Discussion in 'Programming' started by Cleptography, Sep 6, 2010.

  1. Cleptography

    Cleptography New Member

    Joined:
    Sep 2, 2010
    Messages:
    39
    Likes Received:
    7
    Trophy Points:
    0
    This batch script is nothing more than a simple pass of command arguments to firefox to open a web page with whois data. Modify as needed.

    Code:
    @echo off
     setlocal
    
    :Check_Program_Path
    if exist "%ProgramFiles%\Mozilla Firefox\firefox.exe" goto :Check_Command_ARG
    goto :ERROR_1
    
    :Check_Command_ARG
    if [%~1]==[] goto :ERROR_2
    
    :: ELSE---
    :Set_VARS
    set FireFox_and_Check="%ProgramFiles%\Mozilla Firefox\firefox.exe"
    set Address=http://whois.domaintools.com/%~1
    
    :Run_FireFox_DirectPage_2_IP_LookUp
    Start %FireFox_and_Check% %Address%
    goto :EOF
    
    :ERROR_1
    echo.FireFox.exe was not found in your path!!!
    goto :EOF
    
    :ERROR_2
    echo.No Address was specified!!!
    echo.
    echo.USAGE: %~0 google.com
    goto :EOF
     

Share This Page