如何从批处理脚本中获取特定的标准输出以重定向到文本文件中

时间:2014-02-26 19:56:19

标签: batch-file exit-code

我有一个通过psftp发送文件的函数。在发送数据后,我得到了终端中的以下输出:

Sent EOF Message
Server send command exit status 0
Disconnected: All channels closed

我只需将读取“服务器发送命令退出状态0”的行回显到文件中。任何建议将不胜感激。

1 个答案:

答案 0 :(得分:1)

yourcommand | findstr /L /c:"Server send command exit status" >yourdestinationfilename

如果需要,请使用>>代替>进行追加,而不是重新创建。

相关问题