Hello dear guest!

Boot Land is a community driven site established since 2006 and focused on data recovery/backup boot disks, research of Windows 2000/XP/2003/Vista/7 install/deployment/antivirus tools, customizing Windows PE systems and even learning how to recover from disaster situations.

How about joining our boot disk community? So do it. Life's short!

  - You get free access to our newsletter with all the interesting buzz about boot disks
  - We share publicity revenue with everyone who wishes to participate at the forums
  - Publicity is never, never, never displayed to members (along with many other cool things)
http://boot-land.net/register

3 Pages V  < 1 2 3 >  
Reply to this topic
 IPconfig, ipconfig
post Oct 5 2008, 02:19 PM
Post #6
was_jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06 From: Gone in the mist

Posts: 7,224
Thank(s): 547


Italy


QUOTE (MedEvil @ Oct 5 2008, 03:36 PM) *
laugh.gif jaclaz thumbup.gif thumbup.gif thumbup.gif, exactly what i was thinking, but were to nice to post. wink.gif


I see it a bit differently, everyone is perfectly free to pursue his/her attempts to re-invent the wheel (or hot water) but they should KNOW it has been already invented, and possibly invent an improved one (like hotter hot water or rounder wheels wink.gif).

http://www.boot-land.net/forums/index.php?...c=2037&st=7

Informing people about this undeniable "historical" fact is not "nice" or "nasty", it's just a little help into avoiding exceeding in complexities:

QUOTE (Albert Einstein)
Everything should be made as simple as possible, but not simpler.


BTW, did you know that actually automotive wheels are being re-invented?

Here is the TWEEL (Tire+WhEEL):
http://en.wikipedia.org/wiki/Tweel
http://www.michelinmedia.com/imageSingle/I...271/kw=MCHtweel
http://www.michelinmedia.com/imageSingle/I...086/kw=MCHtweel

cheers.gif

jaclaz


--------------------
+Quote Post
post Oct 6 2008, 01:39 AM
Post #7
Myk3
Member   **
Group: Members

  Joined: 19-February 08
Posts: 98
Thank(s): 0


United States


Jaclaz,

Thanks for the help.. Works like a charm.. I am going to use your way since it does not require a extra application to be used..

I did modify it slightly however..
Myk3

CODE
for /f "tokens=2 delims=:" %%A in ('IPCONFIG^|FIND "IP"') do [b]set ip[/b]=%%A


I am using this to set a network based TV tuner to stream to the appropriate pc.. and it works like a charm.. Thanks..

+Quote Post
post Oct 6 2008, 11:58 AM
Post #8
paraglider
Silver Member   ****
Group: .script developer

  Joined: 12-August 06 From: NC,USA

Posts: 855
Thank(s): 101


United States


Also does not work if you have more than one network card or if you have vmware installed which installs 2 virtual network adapters. Needs to return the first address not the last.
+Quote Post
post Oct 6 2008, 12:13 PM
Post #9
paraglider
Silver Member   ****
Group: .script developer

  Joined: 12-August 06 From: NC,USA

Posts: 855
Thank(s): 101


United States


For those cases this works better:

CODE
@echo off
for /f "tokens=2 delims=:" %%A in ('IPCONFIG^|FIND "IP"') do (if not X%%AX==XX ( echo %%A & goto :eof ))
:eof
+Quote Post
post Oct 7 2008, 01:10 AM
Post #10
Myk3
Member   **
Group: Members

  Joined: 19-February 08
Posts: 98
Thank(s): 0


United States


so your saying if multiple nic are used (such as laptop wifi and lan) this other code will work better?

CODE
@echo off
for /f "tokens=2 delims=:" %%A in ('IPCONFIG^|FIND "IP"') do (if not X%%AX==XX ( echo %%A & goto :eof ))
:eof


Myk3
+Quote Post
post Oct 7 2008, 03:21 AM
Post #11
paraglider
Silver Member   ****
Group: .script developer

  Joined: 12-August 06 From: NC,USA

Posts: 855
Thank(s): 101


United States


I am saying my tweak will return the first network address not the last. Only you can determine if this better or worse than the original.
+Quote Post
post Oct 15 2008, 01:54 PM
Post #12
Myk3
Member   **
Group: Members

  Joined: 19-February 08
Posts: 98
Thank(s): 0


United States


Since this is still a IPconfig thread..

Is there a way to display the full config "ipconfig /all" of only one adapter, and not all the adapters on the unit.?

+Quote Post
post Oct 15 2008, 04:22 PM
Post #13
Myk3
Member   **
Group: Members

  Joined: 19-February 08
Posts: 98
Thank(s): 0


United States


I think i have figured it out.. I used Jaclaz's stuff to figure it out..
CODE
for /f "tokens=1 delims=" %A in ('IPCONFIG /ALL^|FIND "DNS Servers"') do echo %A


edit: This will only display the first DNS Server not the 2nd.. Is there a way to display both?
+Quote Post
post Oct 15 2008, 04:35 PM
Post #14
was_jaclaz
Finder   ******
Group: Advanced user

  Joined: 14-July 06 From: Gone in the mist

Posts: 7,224
Thank(s): 547


Italy


You need a few more lines, something like this should work (just a base, to be tested and adapted to your needs):
CODE

@ECHO OFF
SET Whattofind=%1
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
SET /A DCounter=0
FOR /f "tokens=2 delims=:" %%A in ('IPCONFIG /ALL ^|FIND "Descr"') do (
REM ECHO %%A
SET /A DCounter=!DCounter!+1
SET Nic_Descr_!DCounter!=%%A
)
SET /A ICounter=0
FOR /f "tokens=2 delims=:" %%A in ('IPCONFIG /ALL ^|FIND "IP."') do (
REM ECHO %%A
Set /A ICounter=!ICounter!+1
SET Nic_IP_!ICounter!=%%A
)

FOR %%A in ( 1 2 3 4 5 6 7 8 9) DO (
IF DEFINED Nic_Descr_%%A SET Nic_Descr_%%A=%%A:!Nic_Descr_%%A:~0,30!:!Nic_IP_%%A!
FOR /F "tokens=1,2,3 delims=:" %%B IN ('ECHO !Nic_Descr_%%A!^|FIND /I "%Whattofind%"') DO ECHO %%C : %%D
)


This accepts one parameter that has to be part of the description string for the NIC.

jaclaz

P.S.: Please note that in the second FOR loop there is a full stop in the search string FIND "IP."' , that I need on Italian OS, for English it should be removed.


--------------------
+Quote Post
post Oct 15 2008, 04:54 PM
Post #15
Myk3
Member   **
Group: Members

  Joined: 19-February 08
Posts: 98
Thank(s): 0


United States


Jaclaz,

The main thing I need the both the DNS servers listed.. I can get the first one but not the 2nd .. Is there a way to do this?

+Quote Post

3 Pages V  < 1 2 3 >
Reply to this topic
1 User(s) are reading this topic ()