Executing Desktop Programs

Your server application can execute desktop programs via the ACUCOBOL-GT C$SYSTEM library routine. To achieve this functionality, add the CSYS-DESKTOP flag to the set of flags passed to C$SYSTEM. This flag indicates that the application wants to run the program on the client machine rather than the application server.

Note that the thin client appears "frozen" while the command executes, in order to return the termination status to the application correctly. To avoid this behavior, run the command asynchronously by specifying the CSYS-ASYNC flag.

For example, the following code fragment starts Notepad on the client machine:

77 flags      pic 9(4) comp

add csys-desktop, csys-async giving flags
call "c$system" using "notepad", flags

Because C$SYSTEM can perform harmful actions on the desktop (like removing files), the thin client asks the user for permission to run the command. The user can choose not to see the question again for a specific application host.

For detailed information about C$SYSTEM, refer to the appendix "Library Routines" in ACUCOBOL-GT Appendices.