Unlike Unix, the line editing capabilities are part of the Windows console windows, not the shell. Because of this, the cmd.exe shell can simply read the input line-by-line and does not perform any special interpretation of your key presses – even CtrlD, Enter will be treated as any other command. You can even make a doskey alias for it:
doskey CtrlD=exit
Windows does have an "EOF" control character, CtrlZ, which works similarly to Ctrl-D in Unix; however, it won't work in this case since cmd.exe simply keeps reading even if hits EOF.
doskey, but enteringCtrl+Disn't easy. The full command isdoskey ?=exitwhere you have to replace?with the character of control code 4. You will need an editor that lets you enter special characters. For example in Vim, you would type (in insert mode)Ctrl+V,4,Enter. – Florian Brucker Jul 26 '13 at 10:03.bashrc). Thanks for pointing out the direct way, though! – Florian Brucker Jul 28 '13 at 17:25Ctrl+Dis pretty straightforward, actually, if you have a keyboard with a numpad: HoldAlt, press004on the keypad, releaseAlt. You can enter any ASCII character this way; it'll work with some Unicode (use the decimal value for the desired character), but I think many symbols are localization dependent. – hBy2Py Jan 13 '15 at 19:02