◄Summary► ◄Up► ◄Contents► ◄Index► ◄Back► ──────────────────────────────────────────────────────────────────────────── If the program is returning to COMMAND.COM, control transfers to the resident portion, and the transient portion is reloaded if necessary. If a batch file is in progress, the next line of the file is fetched and interpreted; otherwise, a prompt is issued for the next user command. MS-DOS then takes the following actions: ■ All memory belonging to the process is released. ■ File buffers are flushed, and any open handles for files or devices owned by the process are closed. ■ The termination handler vector (Int 22h) is restored from PSP:000Ah. ■ The CTRL+C handler vector (Int 23h) is restored from PSP:000Eh. ■ The critical-error handler vector (Int 24h) is restored from PSP:0012h (MS-DOS versions 2.0 and later). ■ Control is transferred to the termination handler. Any files that have been written to using FCBs should be closed before performing this exit call; otherwise, data may be lost. Other methods of performing a final exit are Int 21h Function 00h, Int 21h Function 31h, Int 21h Function 4Ch, and Int 27h. If the program is running on a network, it should remove all locks it has placed on file regions before terminating. Int 21h Functions 31h and 4Ch are the preferred method for termination because they allow a return code to be passed to the parent process. -♦-