Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get internet IP, local IP and Country Batch File
01-12-2010, 11:58 PM
Post: #1
Get internet IP, local IP and Country Batch File
This is powerful Batch file. You can see your IP data and other data with it.
This is for Batch lovers.
Code:
@echo off
color 0A
title MY IP
:start
cls
echo Function MyIP_XMLHTTP( )>wan.vbs
echo     Dim objRequest, strURL >>wan.vbs
echo     MyIP_XMLHTTP = "0.0.0.0" >>wan.vbs
echo     strURL = "http://www.whatismyip.com/automation/n09230945.asp" >>wan.vbs
echo     Set objRequest = CreateObject( "Microsoft.XMLHTTP" ) >>wan.vbs
echo     objRequest.open "GET", strURL, False >>wan.vbs
echo     objRequest.send vbNull >>wan.vbs
echo     If objRequest.status = 200 Then MyIP_XMLHTTP = objRequest.responseText >>wan.vbs
echo     Set objRequest = Nothing >>wan.vbs
echo End Function >>wan.vbs
echo ret = MyIP_XMLHTTP( ) >>wan.vbs
echo Set FSys = CreateObject("Scripting.FileSystemObject") >>wan.vbs
echo Set MonFic = FSys.CreateTextFile("00001.tmp") >>wan.vbs
echo With MonFic >>wan.vbs
echo .writeLine ret >>wan.vbs
echo End With >>wan.vbs
call wan.vbs
::---------------------
for /F "tokens=* delims=" %%a in (00001.tmp) do set wanIP=%%a
del /F /Q wan.vbs >NUL
del /F /Q 00001.tmp >NUL
::---------------------
ipconfig |find "IPv4" > 00002.tmp
for /f "tokens=2 delims=:" %%a in (00002.tmp) do set lanIP=%%a
del /F /Q 00002.tmp >NUL
::---------------------
for /F "tokens=* delims=" %%i in ('reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MUI\UILanguages"') do set lang=%%i
set lang=%lang:~68,5%
::---------------------
cls
echo.
echo ^>^>^> Local IP:%lanIP%
echo ^>^>^> Internet IP: %wanIP%
echo ^>^>^> Localisation: %lang%
echo.
pause

"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: