bat中获取bat命令结果
- FOR 循环,一行行处理
FOR /F ["options"] %variable IN ('command') DO command [command-parameters] - 先重定向输出到文件,再读取文件
set /p str=
- 管道
>dir d:\ /s /b | find ".log"
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/205290.html原文链接:https://javaforall.net
bat中获取bat命令结果bat 中获取 bat 命令结果 FOR 循环 一行行处理 FOR F options variableIN command DOcommand command parameters 先重定向输出到文件 再读取文件 set pstr a txt 管道 dird s b find log a txt 管道
FOR /F ["options"] %variable IN ('command') DO command [command-parameters]set /p str=
>dir d:\ /s /b | find ".log"
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/205290.html原文链接:https://javaforall.net