Differences
This shows you the differences between the selected revisions of the page.
| 2009-11-21 | 2010-08-14 | ||
| fix waiting loop (martin) | while loop checking for status make it hang when output fuffer overflows (martin) | ||
| Line 39: | Line 39: | ||
| "ls\n" + | "ls\n" + | ||
| "exit\n"); | "exit\n"); | ||
| - | // wait until it finishes | + | // wait until it finishes and collect its output | 
| - | while (exec.Status == 0) | + | var output = exec.StdOut.ReadAll() | 
| - | { | + | // optionally print the output | 
| - | WScript.Sleep(100); | + | WScript.Echo(output); | 
| - | } | + | |
| - | </code> | + | |
| - | + | ||
| - | If you want to see WinSCP output modify the trailing ''while'' as: | + | |
| - | + | ||
| - | <code javascript> | + | |
| - | // wait until it finishes | + | |
| - | while (exec.Status == 0) | + | |
| - | { | + | |
| - | WScript.Sleep(100); | + | |
| - | ····WScript.Echo(exec.StdOut.ReadAll()); | + | |
| - | } | + | |
| </code> | </code> | ||