SHELLcommand
(SHELLcommand
wait
)
Runs an input string as a shell command. Outputs TRUE if the command was executed, FALSE otherwise. If the command is a literal list in the instruction line, and if you want a backslash character sent to the shell, you must use \\ to get the backslash through Logo's reader intact.
The optional wait
input controls whether FMSLogo waits for command
to finish running before it runs the next instruction.
If present, wait
must be either TRUE or FALSE.
When no wait
input is given, SHELL does not wait for the command to finish.
If your command
contains spaces in the file path to the executable, it's a good idea to put double-quotes around it, or else you may end up running the wrong program.
For example, if a file named c:\Program.exe
exists, then the following instruction runs c:\Program.exe
with the command-line parameter Files\Audacity\audacity.exe
:
SHOW SHELL [C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe]
However, the following instruction always runs audacity.exe
, regardless of whether c:\Program.exe
exists:
SHOW SHELL [\"C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe\"]
SHOW SHELL [notepad c:\\test.txt]
true
SHOW SHELL [unknown-app c:\\test.txt]
false