Written by

Developer Support Engineer at InterSystems Japan
Article Megumi Kakechi · Nov 23, 2023 1m read

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:

About $ZF(-100) [IRIS]
About $ZF(-100)

Comments

Yaron Munz · Nov 24, 2023

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)

0