使用命令:for /r [dirname] %i in (*.png) do @echo %i >>[dirname/]img_path.txt 若使用>而不是>>则覆盖上一次输入,即最后得到的文件只有最后一条输入