>An application runs DOS commands using the "!" command.
>When the DOS command completes the operator has to exit the DOS window manually for the program to proceed.
>How can that DOS window be closed from the Fox program?
Create a .PIF for the app with the check box for Close on Exit checked, and the problem goes away. Better, change the default PIF for DOS apps (not FOXRUN.PIF, but the system DEFAULT PIF file with this behavior, and use API_APPRUN.
API_APPRUN also exposes a method to permit you to kill a process launched by it programmatically. See the Files section.