[英]CMD - get MAC address of iPhone
我试图从我的 Windows 机器上获取我的 iPhone 的 MAC 地址。
GETMAC /s 10.30.114.14
它返回:
错误:RPC 服务器不可用
但是,如果我尝试获取任何其他设备(笔记本电脑和其他设备)的 MAC 地址,我会在几毫秒内获得一个正确的地址。
所以我问:有没有办法从 CMD 获取 iDevice 的 MAC 地址?
**我知道我可以查看设备设置,但这真的不是我想要的。
ping
它,然后从arp
缓存中获取 MAC:
@echo off
set IP=10.30.114.14
ping -n 1 %IP% >nul
for /f "tokens=2" %%a in ('arp -a ^| find "%IP%"') do set MAC=%%a
echo MAC: %MAC%
pause
假设您有带有计算机或IP地址列表的输入文件,您可以尝试使用批处理文件:
@echo off
Title Get IP and MAC address for remote PCs over the network using batch
Set "Copyright=by Hackoo 2021"
Title %~nx0 %Copyright%
Mode con cols=90 lines=12
cls & color 0A & echo.
echo ********************************************************************************
echo Get IP and MAC address for remote PCs over the network by %Copyright%
echo ********************************************************************************
echo(
if _%1_==_Main_ goto :Main
:getadmin
echo %~nx0 : self elevating
set vbs=%temp%\getadmin.vbs
(
echo Set UAC = CreateObject^("Shell.Application"^)
echo UAC.ShellExecute "%~s0", "Main %~sdp0 %*", "", "runas", 1
)> "%vbs%"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
goto :eof
::-------------------------------------------------------------------------------------
:Main
set "InputFile=%~dp0Hosts.txt"
set "OutPutFile=%~dp0IP-MAC.txt"
If Exist "%OutPutFile%" Del "%OutPutFile%"
If Not Exist "%InputFile%" (
color 0C & echo "%InputFile%" does not exist. Please check it first !
Timeout /T 8 /NoBreak>nul & Exit
)
Netsh interface ip delete arpcache >nul 2>&1
@for /f "tokens=* delims=" %%H in ('Type "%InputFile%"') do (
Ping -n 1 %%H>nul
@for /f "tokens=2" %%M in ('arp -a %%H ^| find "%%H"') do (
echo %%H : %%M
echo %%H : %%M>>"%OutPutFile%"
)
)
If Exist "%OutPutFile%" Start "" "%OutPutFile%" & Timeout /T 1 /NoBreak>nul & Exit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.