Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Environmental Variable for NIC IP

1 view
Skip to first unread message

hack.bac

unread,
Jan 23, 2008, 12:32:52 AM1/23/08
to
Is there a way to create an Environmental Variable to generate a
dynamic IP address off of a NIC?
That is, something like %IP_Local_Area_Connection% would respond with
the NIC IP?
I'm trying to place an addition variable into the Target field of a
Shortcut for a game, which would include an IP address that might
change.

Arkadiusz 'Black Fox' Artyszuk

unread,
Jan 26, 2008, 2:50:33 AM1/26/08
to
hack.bac wrote:

AFAIK there's no such variable. You may try to set it yourself using
system tools like ipconfig and cmd scripts. Using some scripts one may
set user variable that presents IP from DHCP. For some help see
http://www.novell.com/coolsolutions/tools/18038.html

--
Regards
Arkadiusz 'Black Fox' Artyszuk

hack.bac

unread,
Feb 19, 2008, 12:05:08 AM2/19/08
to
On Jan 25, 11:50 pm, Arkadiusz 'Black Fox' Artyszuk <black...@x-

privat.org> wrote:
> hack.bac wrote:
> > Is there a way to create an Environmental Variable to generate a
> > dynamic IP address off of a NIC?
> > That is, something like %IP_Local_Area_Connection% would respond with
> > the NIC IP?
> > I'm trying to place an addition variable into the Target field of a
> > Shortcut for a game, which would include an IP address that might
> > change.
>
> AFAIK there's no such variable. You may try to set it yourself using
> system tools like ipconfig and cmd scripts. Using some scripts one may
> set user variable that presents IP from DHCP. For some help seehttp://www.novell.com/coolsolutions/tools/18038.html

>
> --
> Regards
> Arkadiusz 'Black Fox' Artyszuk

Awesome, thanks for the help!
Here's the batch file I put together based on the novell.com/
coolsolutions.

REM Copy Hamachi IP
ipconfig > %TEMP%\ipconfig.tmp
type %TEMP%\ipconfig.tmp | findstr "IPv4 Address" > %TEMP%\ip.tmp
type %TEMP%\ip.tmp | findstr 5.[0-9]*.[0-9]*.[0-9]*$ > %TEMP%\ip2.tmp
FOR /F "TOKENS=14 DELIMS= " %%A IN ('type %TEMP%\ip2.tmp') DO SET MYIP=
%%A

REM Clean UP
del %TEMP%\ipconfig.tmp
del %TEMP%\ip.tmp
del %TEMP%\ip2.tmp

echo %MYIP%

0 new messages