wmic查詢ip

@echo off
for /F "usebackq" %%R in (`wmic PATH Win32_NetworkAdapterConfiguration WHERE "IPEnabled = True and not MACAddress like '00:%'" get Ipaddress`) do (
    rem echo OUTPUT is %%R
 set IP=%%R
 echo %%R
)

以上腳本會排除虛擬網卡(00:) 其餘類型虛擬網卡自行添加spa

相關文章
相關標籤/搜索