Question

Locked

CMD Prompt: Exit Required?

By Jay ·
It used to be required to issue the EXIT command to close a Command session otherwise it would be left running. Is this no-longer necessary? Does terminating the window now also exit the session as well?

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Exit

by p.j.hutchison In reply to CMD Prompt: Exit Require ...

Yes, you can use either the Close Window or exit command to close the session, although if you use Command.com instead of Cmd.exe then running Exit is preferred.

Collapse -

A bit more info

by Jacky Howe In reply to CMD Prompt: Exit Require ...

Syntax:
<br>
EXIT
<br>
Purpose: Exits a secondary command processor.
<br>
Discussion
<br>
This command can be used when you are running an application program and want to start the DOS command processor, then return to your program. For example, to look at a directory on drive B while running an application program, you must start the command processor by typing COMMAND in response to the default drive prompt. You can now type the DIR command and DOS will display the directory for the default disk. When you type EXIT, you return to the previous level (your application program).
<br>
Example
<br>
If you start a new command processor by entering
<br>
command /c
<br>
then you can return to the previous command processor by entering
<br>
exit
<br>
It really depends on the type of batch file that you are running as to whether it will automatically exit when the commands have been completed. If you run cmd and open a window when you type in exit it will end the session.
<br>
Terminating a session will close it as well.
<br>
If you are using the goto syntax it is wise to direct it to :END to close the session.
<br><br>
<i>Keep us informed as to your progress if you require further assistance.</i>
<br><br>
<i>If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as <b>Helpful</b> so that others may benefit from the outcome.
</i>

Collapse -

Mandatory vs Best Practice

by Jay In reply to A bit more info

Of course in batch files it is necessary. My question relates more to user session windows. It used to be stressed NEVER to simply close the window as this would leave the session running. (NT) Because we don't see this stressed anymore can we safely assume that closing the window now also terminates (exits/kills) the session?

Collapse -

Not unless you're sure how the session began. <NT>

by OldER Mycroft In reply to Mandatory vs Best Practic ...
Collapse -

closing the window now also terminates

by Jacky Howe In reply to Mandatory vs Best Practic ...

the session. You can CTRL+C to stop the batch process or close the window.
<br><br>
<i>Keep us informed as to your progress if you require further assistance.</i>
<br><br>
<i>If you think that any of the posts that have been made by all TR Members, have solved or contributed to solving the problem, please Mark them as <b>Helpful</b> so that others may benefit from the outcome.
</i>

Back to Software Forum
6 total posts (Page 1 of 1)  

Related Discussions

Related Forums