1

I have some problems with running .exe command on Windows10 on-premise instance. I trying do like this:

- Choosing "AWS-RunPowerShellScript" as Document
 - Adding my commands which I need to execute. For example: 
   cd "C:/Program Files (x86)/MyDirectory/"
   ./myFile.exe
 - Choosing my instance and adding comments
 - Run

Then my RunCommand have success status. But in output i got this:

enter image description here

htshame
  • 6,599
  • 5
  • 36
  • 56
  • This is almost certainly a case of ASCII vs. UTF-8 encoding. If you send the output to a S3 bucket and download the resulting file, do you get the correct output displayed? Also, the .exe that you're running, is that something that's generally available so we can try to reproduce or is it a custom .exe that's restricted (e.g. licensing, in-house developed or anything else)? – Mats Lannér Jan 21 '19 at 15:54
  • I agree that symbols like this ��� means problems with encoding. But in the comments main problem is that "CategoryInfo : ObjectNotFound: (auto.cmd:String) [], CommandNot FoundException". I just want to know how can i run *.exe files via RunCommand SSM. – Mrg.Dweller Jan 22 '19 at 07:47
  • Using the AWS CLI, you can send a command like this: `$ aws ssm send-command --document-name "AWS-RunPowerShellScript" --targets "Key=instanceids,Values=i-123example456" --parameters '{"workingDirectory":["c:\\"],"commands":["cmd.exe /c date /t"]}' --comment "Simple command" --region us-east-2` This will run cmd.exe to display the current date in the command output. – Mats Lannér Jan 31 '19 at 00:59
  • @MatsLannér Is it only for OS embedded commands (like ping or dir)? Can I execute any program like browser? – Mrg.Dweller Feb 01 '19 at 07:36
  • The Run Command feature of Systems Manager doesn't give you any interactive access to the .exe you run (i.e. if you launch a browser, you can't interact with it in any way). The intention is really for running commands that can be fully controlled from the command line (i.e. if you wanted to download something from the web you could use PowerShell features like Invoke-WebRequest or tools like curl). – Mats Lannér Feb 02 '19 at 15:12

0 Answers0