Yuri Marx · Jan 20, 2021 1m read

Running shell commands in ObjectScript

Sometimes it is necessary to execute commands from the shell of the host operating system, where your ObjectScript program is located, to launch programs, operating system services, schedule crontasks, among other activities. For this, the language has a utility procedure called $ZF(-100). See:


Where flags is the type of command you want to execute. In our case, the flag is "/ SHELL", to execute shell commands on the host operating system.

Program is the name of the program or service to be executed.

Args are execution arguments passed to the program.

An example would be to print some content at the prompt, for example:


If your program depends on changing the current directory, to run the program, use the following command before the call:

Do ##class(%SYSTEM.Process).CurrentDirectory("/path/")
2 567
Discussion (2)1
Log in or sign up to continue

Great resource Cemper! Thanks for sharing