Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios CMD-获取iPhone的MAC地址_Ios_Iphone_Batch File_Cmd - Fatal编程技术网

Ios CMD-获取iPhone的MAC地址

Ios CMD-获取iPhone的MAC地址,ios,iphone,batch-file,cmd,Ios,Iphone,Batch File,Cmd,我正试图从我的windows机器上获取iPhone的MAC地址 GETMAC /s 10.30.114.14 它返回: 错误:RPC服务器不可用 但是,如果我尝试获取任何其他设备(笔记本电脑等)的MAC地址,我会在毫秒内获得一个好地址 所以我在问:有没有办法从CMD获得iDevice的MAC地址 **我知道我可以查看设备设置,但这并不是我想要的。pingit,然后从arp缓存中抓取MAC: @echo off set IP=10.30.114.14 ping -n 1 %IP% >n

我正试图从我的windows机器上获取iPhone的MAC地址

 GETMAC /s 10.30.114.14
它返回:

错误:RPC服务器不可用

但是,如果我尝试获取任何其他设备(笔记本电脑等)的MAC地址,我会在毫秒内获得一个好地址

所以我在问:有没有办法从CMD获得iDevice的MAC地址


**我知道我可以查看设备设置,但这并不是我想要的。

ping
it,然后从
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

假设您有一个带有计算机的inputfile或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

非常感谢你!与这个问题无关,我告诉你你帮了我多少。我创建了一个PHP脚本,用于ping路由器上的所有地址,如果ping成功,它将获取mac地址。这花了一分钟。现在,你的代码需要几秒钟。非常感谢。这是最终的解决方案:“arp-a”,然后是“netsh接口ip删除arpcache”。这是下一次检查(我每分钟检查一次),它将是干净的数据,而不是来自缓存。对速度感兴趣吗<(1,1254)do@start”“/b cmd/c”ping-n 1-w 150-a 192.168.178中的/l%i的代码>需要7秒。