for循环设置变量时,请开启环境变量延迟命令setlocal enabledelayedexpansion然后变量调用时原%换成!@echo offsetlocal enabledelayedexpansionadb shell dumpsys meminfofor /l %%i in (1,1,5) do ( SET /P PID=输入PID号: adb shell dumpsys meminfo -a !PID! >> c:\123.csv)pause