Go Back   WhatIsMyIP.com® Forum > All About Code > Code Samples

Notices

Code Samples Got code samples that you want to share. Please title threads accordingly and add what you're willing to share.

Closed Thread
 
Thread Tools Display Modes
Old 07-10-2012, 11:51 PM   #1
Shnerdly
• The †erminator
 
Shnerdly's Avatar
 
Join Date: Jun 2010
Location: The frozen tundra of Minnesota
Posts: 1,123
Shnerdly has disabled reputation
Default Batch File to determine your Internal IP

I found this batch file on the Internet. It shows you your Internal IP Address. It may be helpful to some people.

You can download it, ready made, here or you can copy the code below and name it whatever you want as long as the file extension is .bat

Code:
@echo off
IPCONFIG |FIND "IP" > %temp%\TEMPIP.txt
FOR /F "tokens=2 delims=:" %%a in (%temp%\TEMPIP.txt) do set IP=%%a
del %temp%\TEMPIP.txt
set IP=%IP:~1%
echo %IP% >%temp%\ip.txt
echo Your Internal IP Address should be "%IP%"
del %temp%\ip.txt
pause
If anyone has any trouble with it or has any improvements, let us know in this thread.
__________________


Grammar is important. For instance, commas save lives:

Let's eat grandpa.

OR

Lets eat, grandpa.

Shnerdly is offline  
Old 07-12-2012, 12:30 PM   #2
wimiadmin
Administrator
 
wimiadmin's Avatar
 
Join Date: May 2008
Location: Sylvania, Georgia, USA
Posts: 1,255
wimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to beholdwimiadmin is a splendid one to behold
Default

Hey Shnerdly,

When I run the script it shows my IP as fe80 which is the first set of numbers in my ipv6 block when I do an ipconfig.

I've attached screenshots in hopes to help you decipher the code.
Attached Images
File Type: jpg my-internal-ip.jpg (12.2 KB, 6 views)
File Type: jpg my-internal-ip-2.jpg (22.5 KB, 6 views)
__________________
Brian
Please Search Before Posting
wimiadmin is offline  
Old 07-12-2012, 03:39 PM   #3
AboveTheLogic
Super Moderator
 
AboveTheLogic's Avatar
 
Join Date: Jul 2008
Location: Las Vegas
Posts: 603
AboveTheLogic is a glorious beacon of lightAboveTheLogic is a glorious beacon of lightAboveTheLogic is a glorious beacon of lightAboveTheLogic is a glorious beacon of lightAboveTheLogic is a glorious beacon of light
Default

Worked just fine for me on windows 7 with my particular setup
AboveTheLogic is offline  
Old 07-12-2012, 07:39 PM   #4
Shnerdly
• The †erminator
 
Shnerdly's Avatar
 
Join Date: Jun 2010
Location: The frozen tundra of Minnesota
Posts: 1,123
Shnerdly has disabled reputation
Default

I looked at my XP setup and it only shows the IP as IP. The image you posted shows it as IPv4. I think it's ignoring the v4 or v6 part and going straight to the last IP listed in ipconfig. I also think it stops reading at the first :.

I don't run IPv6 yet. I've been putting it off because it makes my brain hurt. I guess I'll have to start getting in to it a little more.

I'll setup a Win7 or Win8 machine and play with it. I wonder if making the end of line 3 from "do set IP=%%a" to "do set IPv4=%%a" would help? I'll try that over the weekend.

I'm not a coder at all so if anyone else has a possible solution, I'm wide open.
__________________


Grammar is important. For instance, commas save lives:

Let's eat grandpa.

OR

Lets eat, grandpa.

Shnerdly is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:04 PM.


What Is My IP

Join WhatIsMyIP.com on Facebook Follow WIMI on Twitter

Need IP address location detection service? Get it from IP2Location.com now.

Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright - WhatIsMyIP.com®