【问题标题】:.exe not getting executed via winrm.exe 没有通过 winrm 执行
【发布时间】:2021-05-05 05:45:47
【问题描述】:

我正在尝试通过 pywinrm 运行一个 exe。架构如下:

code --> host Machine (1)--> another machine where exe is located(2)

我可以通过代码连接到主机 1 并在那里执行 echo 语句。但是当我尝试通过

执行exe时
session.run_cmd('start \\machine2IP\path\to\exe\filename.exe')

它不工作。当我手动打开机器 1 的 cmd 并运行时,相同的命令正在工作。

我尝试添加 -Wait 参数,同时使用 & 和 run_ps 运行。但仍然没有运气。

【问题讨论】:

    标签: python python-3.x exe winrm


    【解决方案1】:

    这需要大量的尝试和错误,但它对我有用。

    session.run_cmd('\\\\machine2IP\path\to\exe\filename.exe')
    

    我从头开始删除并使用 4 '' 而不是 2 ''。它对我有用。

    【讨论】:

      猜你喜欢
      • 2019-05-02
      • 2017-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-06
      • 1970-01-01
      相关资源
      最近更新 更多