<pre class="c" name="code">@echo off
for /f "skip=1 tokens=3 delims=," %%i in ('"getmac /v /fo csv"') do echo %%i
限制條件:
<pre class="c" name="code">ipconfig /all | find "Physical" > c:\temp\mac.tmp
FOR /F "TOKENS=12* DELIMS= " %%A IN ('type C:\temp\mac.tmp') DO SET mac=%%A
echo %mac%
可以單獨取出 MAC 訊息,
關鍵是在第二行字串擷取的寫法!