- 帖子
- 52
- 积分
- 69
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2022-11-21
|
已解决
本帖最后由 dos-a 于 2023-4-9 15:24 编辑
代码块:
setlocal enabledelayedexpansion
set "al=adb"
set "cnt="
echo,
for /f "skip=1 tokens=1,4 delims= " %%a in ('!al! devices -l') do (
set "serial=%%a"
set "model=%%b"
set nc=0
set SS=0
set aq=
set "version="
set "system="
set "cv="
if "!Model!"=="" (
set "model=model:未连接 "
) else (
set "modelw=!Model:_=-!"
for /f "delims=" %%a in ('cmd/u/cecho !modelw!^|more')do set /a nc+=1
set /a SS=20-!nc!
for /L %%i in (1,1,!ss!) do (
set "aq=!aq! "
)
set "model=!modelw!!aq!"
)
for /f "delims=" %%c in ('start /b !al! -s !serial! shell "getprop hw_sc.build.platform.version | tr -d '\n'" 2^>nul') do (
set "cv=%%c"
)
if "!cv!"=="" (
set "sv="
for /f "delims=" %%s in ('start /b !al! -s !serial! shell "getprop ro.build.version.release | tr -d '\n'" 2^>nul') do (
set "sv=%%s"
)
if "!sv!"=="" (
set "system=未连接"
) else (
set "version=!sv!"
set "system=安卓"
)
) else (
set "version=!cv!"
set "system=鸿蒙"
)
set /a cnt+=1
echo [!cnt!] 系统版本: !system! !version! !model!序列号: !serial!
echo,
) |
|