从plink获取返回码? [英] get return code from plink?

查看:132
本文介绍了从plink获取返回码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DOS批处理脚本中,我正在使用plink在远程(也是Windows)计算机上运行单个命令.以前,此命令仅在本地计算机上运行,​​并且依赖于返回码来确定成功.有没有一种方法可以通过plink轻松获取这些信息?

In a DOS batch script, I'm running a single command on a remote (also windows) computer using plink. Formerly, this command was only run on the local machine, and was relying on the return code to determine success. Is there a way to easily get this information back through plink?

推荐答案

对于plink,这是不可能的.当前的共识是将远程脚本echo的退出代码保存到日志文件,然后使用pscp将该日志文件传输到本地计算机.

That's not possible with plink. The current consensus is to have the remote script echo its exit code to a log file, then use pscp to transfer the log file to the local machine.

请参见 http://fixunix.com/ssh/74235-errorlevel-capturing -plink.html .

这篇关于从plink获取返回码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆