Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Function Key to type "Exit" when at the command prompt 2

Status
Not open for further replies.

merctwister

Technical User
Nov 12, 2005
27
US
Is there any way to use a function key or a single keystroke to "exit" from the Dos command prompt without
having to actually type the word "exit" every time?
 
If it is a CMD.EXE prompt (and not a COMMAND.COM prompt), you can click the X in the top right corner to close the box. With COMMAND.COM, the system asks you to End Task so doing this with CMD.EXE is preferred

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
When I encounter a system that I've not been working on before, the first thing I do is create a
%SYSTEMROOT%\windows\system32\x.cmd
The x.cmd contains only one small line:

@Exit

So when I have a Command Prompt, I just have to hit the [X] with my left hand and hit [Enter] with my right hand.
And it follows the KISS rules.
 
I changed from full screen to maximized and then I could
click on the X in the upper right corner.

I made an X.cmd file...that works too!

Mission Accomplished!
Thanks for the help!
 
The x.cmd contains only one small line:
@Exit
"""""
which language is this written? dos? or what? can you please explain?
 
In simple terms: create a blank text document, type @Exit into it, save it, and rename it to x.cmd

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
but how do you invoke it in a command prompt?
i'm thinking about finding out how to program function keys and assigning commands to it. you used to be able to do it in old ibm machines. 1980's. i don't know about now. it might be worth looking into. i'll research.
 
If you follow PalmTest's instructions and place the x.cmd file in C:\Windows\System32, you invoke the x.cmd program by typing x in the command prompt. This will run x.cmd and close the CMD window

------------------------------------------------------------------------------------
"Life is like a box of chocolates, you never know what you're gonna get!"
------------------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top