Search the Community
Showing results for tags 'run×runwait×dos×stdout×cmd×'.
-
I have installed the amazon command-line interface (http://aws.amazon.com/cli/) and have it working in my cmd prompt dos window. For example, If I set the working directory to C:UsersAdministrator and run the command below to upload a file to the S3 service: aws s3 cp C:UsersAdministratorDesktopvpntimeout_text.txt s3:/clustertesting/vpntimeout_text.txt I get the response: upload: myfolder/file1.txt to s3:/mybucket/myfolder/file1.txt However, trying to replicate the same command in Autoit with : --------------------------------------------------------------------------- #include <Constants.au3> ;$ami_ID = "ami-1a0d912a" ;$n=1 ; Command: ;$DOS = Run(@ComSpec & ' /k' & "aws ec2 run-instances " & $ami_ID & " -n " & $n & " -k windows --instance-type t1.micro -g quicklaunch-1", "", "", $STDERR_CHILD + $STDOUT_CHILD) $workingdir = "C:UsersAdministrator" ConsoleWrite($DOS & @CRLF) Local $output While 1 $line = StdoutRead($DOS) If @error Then ExitLoop ConsoleWrite($line) Wend ConsoleWrite($line & @CRLF) ConsoleWrite("error = " & @error & @CRLF) --------------------------------------------------------------------------- The dos window flashes up and a PID is returned in $DOS, and the error value is zero. However, unlike my command performed in the command prompt, the autoit version does not upload my file to S3 and does not print a response. Does anyone see what I've done wrong in Autoit? From what I can tell me code should be performing the same command sorry I haven't used the code editor for this post- it failed to work in two browsers o I ended up just pasting the raw text
- 4 replies
-
- run×runwait×dos×stdout×cmd×
- run
- (and 4 more)