【问题标题】:AWS Systems Manager Run Command - execute .exe file on EC2 instanceAWS Systems Manager Run Command - 在 EC2 实例上执行 .exe 文件
【发布时间】:2019-04-29 15:49:44
【问题描述】:

情况如下。我们有一个运行 Windows 的 EC2 实例,它每天使用 Windows 任务计划程序运行多个程序。我们可能希望用 AWS Systems Manager 维护时段替换此设置。 但在此之前,我想从小处着手,只需使用 Systems Manager Run Command 在 EC2 实例上运行 exe。我能够定位我的实例,并且我知道必须编写 SSM 文档来定义命令,因此我尝试使用具有以下 JSON 文档结构的“aws:runPowerShellScript”:

{
 "schemaVersion": "2.2",
 "description": "Scheduled Scripts Launcher",
 "mainSteps": [
{
  "action": "aws:runPowerShellScript",
  "name": "run_script",
  "inputs": {
    "runCommand": [
      "& 'C:/Users/Administrator/Desktop/sc/TestApp.exe'"
    ]
  }
}
]
}

带有此文档的运行命令报告成功,但目标实例上的程序未运行。也许我根本无法以这种方式启动 exe;欢迎任何指点。

【问题讨论】:

    标签: amazon-web-services amazon-ec2


    【解决方案1】:

    找到了解决方案。有必要明确指定目录。所以这是在runCommand下添加的:

    "workingDirectory": "C:/Users/Administrator/Desktop/sc"
    

    【讨论】:

    • 很好,也许将运行命令也只替换为 TestApp.exe 会起作用吗?
    猜你喜欢
    • 2021-05-18
    • 2020-02-06
    • 1970-01-01
    • 2021-04-15
    • 1970-01-01
    • 2020-11-10
    • 2020-09-04
    • 2021-06-13
    • 1970-01-01
    相关资源
    最近更新 更多