0

I am currently making a script with a menu system and a sub menu. But I would like to make the Ctrl+C button go back to the main menu (referenced as :start) instead of trying to terminate the batch job. Is this possible?

  • No. Ctrl+C breaks out of a batch file. There's no way in batch to divert it to another purpose. – Ken White Jun 08 '16 at 21:50
  • Maybe a duplicate of http://stackoverflow.com/questions/27130050/batch-script-if-user-press-ctrlc-do-a-command-before-exitting – rrauenza Jun 08 '16 at 21:53
  • That's a very counter-intuitive design choice; I'd never expect CTRL+C to go up one menu level. You may want to check out http://ux.stackexchange.com/ – SomethingDark Jun 08 '16 at 22:16
  • 1
    You could launch your sub menu in a child cmd session [similar to dbenham's solution here](http://stackoverflow.com/a/27131024/1683264). Just have the outer script redisplay the main menu when the child menu exits. – rojo Jun 08 '16 at 23:07

0 Answers0