Hey Ryan...
Heres some code you can try out. Im sure some of the above UDF links do close to the same thing but I was bored. Tested it on XP and 98. Would also suggest the built in EnumIPInfo function BUT it has a lot of dependencies (especially doesnt work on NT!).
code:
$tempfile = "%temp%\ipinfo.xxx"
$filehandle = FreeFileHandle()
Del $tempfile
If @inwin=2
shell 'winipcfg /batch $tempfile'
Else
shell '%comspec% /c ipconfig > $tempfile'
Endif
If Open ($filehandle, "%temp%\ipinfo.xxx")=0
$line = ReadLine($filehandle)
While @ERROR=0
If Instr ($line, "Default Gateway")
If $DefaultGateway = ""
$DefaultGateway = Trim (SubStr ($line, InStr ($line, ":")+1))
$InstallServer = SubStr ($DefaultGateway, 1, InStrRev ($DefaultGateway, "."))
$InstallServer = $InstallServer+"21"
Else
? "More than one default gateway found...Aborting"
Exit
Endif
Endif
$line = ReadLine($filehandle)
LOOP
$null = Close ($filehandle)
Del $tempfile
? "Default gateway is "+$DefaultGateway
? "App will be run from "+$InstallServer
Else
? "IP Info file could not be opened, error code: "+@ERROR
Endif
get $
[ 10. March 2003, 03:32: Message edited by: CitrixMan ]