|Purpose:||Start a console (character-mode) application in detached mode|
|Format:||DETACH [/Q] command|
|command||The name of a command to execute, including an optional drive and path specification and any parameters. The name must be enclosed in double quotes if it contains any spaces.|
When you start a program with DETACH, that program cannot use the keyboard, mouse, or video display. It is "detached" from the normal means of user input and output. However, you can redirect the program's standard I/O to other devices if necessary, using redirection symbols. In most cases, you should only DETACH text-mode programs, since most graphical applications cannot run without a screen or keyboard, or have their input and output redirected.
The command can be an internal command, external command, alias, or batch file. If it is not an external command, TCC will detach a copy of TCC to execute the command.
For example, the following command will detach a copy of TCC to run the batch file XYZ.BTM:
You can also include any parameters or command line switches which the command knows how to interpret:
detach "xyz.btm Monday Nebraska"
If you prefer, you can use the Linux syntax of putting a trailing & on the command line instead of specifying DETACH. (TCC will convert it to a DETACH before executing the command.)
Once the program has started, TCC returns to the prompt immediately. It does not wait for a detached program to finish.
The Process ID of the detached program is returned in the _DETACHPID variable.
You can use the TASKEND command to stop a detached program which does not terminate on its own.