How to execute the OS commands
InterSystems FAQ rubric
When executing OS commands, use $ZF(-100).
do $ZF(-100,"",program,args) // Execute the Windows command [synchronously].do $ZF(-100,"/ASYNC",program,args) // Executes a Windows command [asynchronously].When executing OS shell commands such as mkdir and copy, also specify /SHELL.
do $zf(-100,"/shell /async","mkdir","c:\temp\x")Please refer to the following documents for details:
Go to the original post written by @Megumi Kakechi
Discussion (2)1
Comments
using the /LOGCMD is very useful to log the resulting command line into messages.log so you could have easy access to see from the SMP.
Also, I/O Redirection could be useful for having input, output, errors linked to files (both Linux and Windows)
Pipes are also a good way to interact with an OS command or external program