根据How do I get the result of a command in a variable in windows?
将命令从 Events Number1 Number2 Time
0 ABC xx xx 25350.0
1 DEF xx 1 12842.0
2 GHI 1 xx 5891.0
3 JKL xx 1 53443.0
4 ABC xx xx 21953.0
5 DEF xx 2 67844.0
6 GHI 2 xx 61782.0
7 JKL xx 2 76168.0
更改为date
,输出变得很奇怪。
这是我的代码
adb devices
输出:
@echo OFF
FOR /F "delims=" %%i IN ('adb devices /t') DO set today=%%i
echo %today%
pause
以其他方式尝试
Usage: adb devices [-l]
同时输出:
@echo OFF
set adbstart=C:\Users\kuanlinchen\AppData\Local\Android\sdk\platform-tools\adb devices
FOR /F "delims=" %%i IN ('call %adbstart% /t') DO set today=%%i
echo %today%
pause
如果我以这种方式运行Usage: adb devices [-l]
,那么工作正常。
adb devices
输出:
@echo OFF
adb devices
pause
奇怪的输出List of devices attached
XXXXXXXXXXXX device
是什么意思?
答案 0 :(得分:2)
adb devices
命令没有/t
参数。如果参数无效,则adb
会显示正确的用法消息。