Detect Lan Connection

No computer connected to the Internet, or any other TCP/IP compliant network, can identify itself as


echo %@if[%_ip eq,0,1]

function IsLan=`%@if[%_ip eq,0,1]`

echo %@IsLan[]

If @IsLan[] returns a 0, then you have no Lan connection.

If @IsLan[] returns a 1, then you have a Lan connection.

You can test this by issuing the IPCONFIG /release command to release the IP address for your adapter, and the IPCONFIG /renew command to renew the IP address for your adapter. (tested on XP).