@echo off & setlocal enabledelayedexpansion  
echo     =-----------------------------------------=
echo     =      本BAT只列出SN码及Mac地址         =
echo     =           读取信息请耐心等待                  =
echo     =-----------------------------------------=
echo.
for /f "tokens=1 delims=[]" %%i in ('%SystemRoot%\system32\nbtstat -S^|find /n "以太网:"') do (
    nbtstat -S | more +%%i >$
    set /p Str=<$
    del $
    for /f "tokens=2 delims=[]" %%i in ('echo "!Str!"') do set LIP=%%i
)
for /f "tokens=1 delims=[]" %%i in ('%SystemRoot%\system32\nbtstat -S^|find /n "WLAN:"') do (
    nbtstat -S | more +%%i >$
    set /p Str=<$
    del $
    for /f "tokens=2 delims=[]" %%i in ('echo "!Str!"') do set WIP=%%i
)
for /f "tokens=16" %%i in ('ipconfig /all ^| find /i "IPv4 地址"') do set ip=%%i ?

echo ===================================================  >%tmp%\mac.txt
@echo off
wmic bios get serialnumber >>%tmp%\mac.txt

echo 本机物理地址： >>%tmp%\mac.txt
echo ===================================================
for /f "tokens=1,3 delims=," %%i in ('getmac /v /nh /fo:csv ^| findstr
"..-..-..-..-..-.."') do (
    echo %%i %%j  >>%tmp%\mac.txt
) 
echo ===================================================  >>%tmp%\mac.txt


Start %tmp%\mac.txt
