...
Scroll tablelayout | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Returns the captured output of the command if the -captureOutput flag is specified.
Examples
Code Block | ||
---|---|---|
| ||
// Show how to use the -dos option, which will delete a file on disk. |
...
// Even though Shogun Post deals with file paths using forward slashes, |
...
// the DOS command interpreter expects back-slashes. This means that you |
...
// will need to use double-back slashes in the string you pass to the |
...
// command since the back-slash is an "escape character" in Shogun Post, |
...
// meaning it is used in combination with the next character to signify |
...
// a special value. In addition, if the file path has a space in it, |
...
// you will need to surround it with quotes as in this example here |
...
// (the same goes if we didn't specify the -dos flag) |
...
system "del \"C:\\PathToSome\\File.dat\"" -dos; |
...
...
// Execute a console application and redirect its output to the Shogun Post |
...
// command prompt. |
...
system "\"C:\\My\\ConsoleApp.exe\" SomeValue AnotherValue" -captureOutput"; |
...
...
// This launches Notepad. Using the -async flag allows the script |
...
// that calls the system command to continue executing. Without it, |
...
// Shogun Post would be hung until the user closed the Notepad window. |
...
system "notepad.exe C:\\SomeFile.txt" -async; |