Maptitude GISDK Help

RunProgram()

Summary

Runs a program, and waits for the program to complete before continuing.

 

Changes

In Version 2016 added the Display option.

In Version 2021 added Input and Output options.

 

Syntax

status = RunProgram(string command_line, array options)

 

Argument Contents
command_line The command line, including arguments and/or switches, used to start the program

 

Option Type Contents
Minimize Boolean If "True" the program is run minimized
Maximize Boolean If "True" the program is run maximized
Display String How to display the application window: "Hidden", "Normal", "Minimized", or "Maximized"
Input String Filename from which Standard Input is redirected
Output String Filename to which Standard Output is redirected
Error String Filename to which Standard Error is redirected

 

Returns

The exit code of the program if the program runs successfully. Most programs return zero upon successful completion.

 

The Windows system error code if there is an error launching the program.  For example, error code 2 means "Not Found", indicating that either the program or a DLL that the program depends on was not found.

 

Notes

Example

status = RunProgram("dirlist.bat", )

status = RunProgram("myprog.exe", {{"Maximize", "True"}})

status = RunProgram("notepad myfile.txt",)

status = RunProgram("cmd /c copy d:\\tmp.txt d:\\bar.txt", )

 

See Also

Function Summary
LaunchProgram() Start a Windows program

 

 

©2025 Caliper Corporation www.caliper.com