• plink_path = "C:/plink.exe"     'plink.exe 路径
  • username = "username"       '用户名
  • password = "password"       '密码
  • host = "192.168.0.1"        'Unix/Linux服务器地址
  • command = "ls"                  '要执行的命令
  • Set oShell = CreateObject("WSCript.shell")
  • '拼成plink的命令,包括登陆和执行命令
  • commandLine = plink_path & " -ssh " & username & "@" & host & " -pw " & password & " " & command
  • '执行
  • Set exeRs = oShell.Exec(commandLine)
  • '获得错误信息
  • errMsg = exeRs.StdErr.ReadAll()
  • '获得标准输出信息
  • stdMsg = exeRs.StdOut.ReadAll()
  • '显示返回信息
  • msgbox stdMsg

Execute Unix Command via Putty_QTP的更多相关文章

  1. UNIX command Questions Answers asked in Interview

    UNIX or Linux operating system has become default Server operating system and for whichever programm ...

  2. DEPRECATED: Use of this script to execute hdfs command is deprecated.

    DEPRECATED: Use of this script to execute hdfs command is deprecated. 本人安装的hadoop版本是2.4.0的,但每次执行命令时都 ...

  3. hadoop2.6.0实践:A01 问题处理 DEPRECATED: Use of this script to execute hdfs command is deprecated.

    [hadoop@hadoop-master data]$ hadoop dfs -ls /DEPRECATED: Use of this script to execute hdfs command ...

  4. [UE4]游戏中服务器切换地图,控制台命令Execute console Command

    Execute console Command ServerTravel {地图名称}?listen 在服务器执行了这个命令,所有连接到该服务器的客户端都会跟着服务器同时切换到指定的地图. 1.创建一 ...

  5. error: internal error: unable to execute QEMU command 'migrate': this feature or command is not cur

    感谢朋友支持本博客,欢迎共同探讨交流,因为能力和时间有限.错误之处在所难免,欢迎指正. 假设转载.请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...

  6. adb错误:Failed to execute android command 'adb devices'.

    好吧,我是用的phonegap3.0开发的,很简单,安装的时候一句phonegap run android –device就可以了(-device参数非必要,我是为了不跑模拟器,加上此参数限制只跑到设 ...

  7. ionic打包apkFailed to execute shell command "input,keyevent,82"" on device: Error: adb: Command failed with exit code 137

    错误代码如下 BUILD SUCCESSFUL in 12s 46 actionable tasks: 1 executed, 45 up-to-date Built the following ap ...

  8. Wrapper: Error - Unable to execute Java command

    在64位的系统下 将短信程序运行于服务中,出现以下错误: Error: [size=14px; line-height: 26px;]FATAL  | wrapper  | 2012/06/18 17 ...

  9. Unix command 积累

    UNIX is a multi-user multitasking-optimized operating system that can run on various hardware platfo ...

随机推荐

  1. Django--Aadmin入门

  2. 基于Diff机制的多个状态合并

    1. 场景 假设一个系统System在某一时刻的状态可以用State A来表示[State里面包含着一些元素的集合]: 1: State A = [element_0, element_1,……,el ...

  3. TypeError: write() argument must be str, not bytes报错

    TypeError: write() argument must be str, not bytes 之前文件打开的语句是: with open('C:/result.pk','w') as fp: ...

  4. c++实现哈夫曼树,哈夫曼编码,哈夫曼解码(字符串去重,并统计频率)

    #include <iostream> #include <iomanip> #include <string> #include <cstdlib> ...

  5. spring boot 多环境(dev、test、prod)配置文件---命令行切换

    properties配置格式 在Spring boot 中多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对于你的环境标识,比如: ...

  6. 一个spark streaming的黑名单过滤小例子

    > nc -lk 9999 20190912,sz 20190913,lin package com.lin.spark.streaming import org.apache.spark.Sp ...

  7. UVA 10256 The Great Divide(凸包划分)

    The Great Divide Input: standard input Output: standard output Time Limit: 8 seconds Memory Limit: 3 ...

  8. 十一、结构模式之享元(Flyweight)模式

    什么是享元模式 享元模式是对象的结构模式,是运用共享技术来有效的支持大量细粒度的对象.享元对象能做到共享的关键是区分内蕴状态和外蕴状态.一个内蕴状态是存储在享元对象内部,并且是不会随环境改变而有所不同 ...

  9. 练手项目之image caption问题记录

    小白一个,刚刚费了老大的劲完成一个练手项目--image caption,虽然跑通了,但是评估结果却惨不忍睹.于是贴上大神的作品,留待日后慢慢消化.顺便记录下自己踩坑的一些问题. 先膜拜下大神的作品. ...

  10. Myeclipse 崩溃闪退 Java was started but returned exit code =-1

    出现如上图所述情况的原因可能是因为虚拟机jdk和myEclipse配置文件中的vm地址发生冲突报出的错误 第一种解决办法:只需要将你jdk文件下的bin目录下的javaw.exe文件的全部路径复制到M ...