Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
@echo offfor /f "tokens=1-26 delims=[]" %%A in ( ' ping %1' ^| find "Pinging" ' ) do set IPaddress=%%Becho IP address is %IPaddress%
C:\>getIP.bat www.computerhope.comIP address is 81.200.64.50
Did you read the Post above ? ?
@echo offsetlocal enabledelayedexpansionset binIP=for /f "tokens=1-2 delims=[]" %%A in ( ' ping %1' ^| find "Pinging" ' ) do set IPaddress=%%Bfor /f "tokens=1-4 delims=." %%B in ("%IPaddress%") do ( call :decbin %%B set binIP=!bstring! call :decbin %%C set binIP=!binIP!.!bstring! call :decbin %%D set binIP=!binIP!.!bstring! call :decbin %%E set binIP=!binIP!.!bstring! )goto end :decbin set bstring= SET /A a=%1 SET /A b= (%a% "&" 128) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 64) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 32) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 16) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 8) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 4) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 2) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 SET /A b= (%a% "&" 1) if %b% EQU 0 (set bstring=%bstring%0) else set bstring=%bstring%1 goto :eof :endecho Decimal IP address is %IPaddress%echo Binary IP address is %BinIP%
C:\>getip2 www.computerhope.comDecimal IP address is 81.200.64.50 Binary IP address is 01010001.11001000.01000000.00110010
this is what i did 5 years back...but i dont remember now
Uh ..., is binary really supposed to work? I get: Firefox can't find the server at 01010001.11001000.01000000.00110010
@echo offsetlocal enabledelayedexpansionset binIP=for /f "tokens=1-2 delims=[]" %%A in ( ' ping %1' ^| find "Pinging" ' ) do set IPaddress=%%Bfor /f "tokens=1-4 delims=." %%B in ("%IPaddress%") do ( call :decbin %%B set binIP=!bstring! call :decbin %%C set binIP=!binIP!.!bstring! call :decbin %%D set binIP=!binIP!.!bstring! call :decbin %%E set binIP=!binIP!.!bstring! )goto end:decbinset /a a=%1set bstring=FOR %%V IN (128 64 32 16 8 4 2 1) do ( SET /A b=%a% "&" %%V if !b! EQU 0 (set bstring=!bstring!0) else (set bstring=!bstring!1) )goto :eof :endecho Decimal IP address is %IPaddress%echo Binary IP address is %BinIP%
I believe the entire point Salmon trout is making is that they are NOT binary numbers, they are Decimal- that is, base-10, numbers.
a normal person doing normal routine task doesn't need to input binary numbers to url to surf a site. I can't think of a reason one wants to do this, except, 1) its homework, 2) you are trying to bypass the security system.