问题描述
在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获取返回码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!