Yes, this could be elegant - just re-associate the .bat extension with cmd.exe.
I tried this and it doesn't help, even when .bat extension is associated with cmd.exe.
- For the same reason - as the original file (or more precisely - its extension - .pox, .ttt, .mkiv, ...) is still associated with a .bat and not an executable:
TCC LE 13.00.23 Windows XP [Version 5.1.2600] Copyright 2011 JP Software Inc. All Rights Reserved C:\Lukas\ConTeXt\Samples>Hello.mkiv TCC: (Sys) Systém nemůže nalézt uvedený soubor. (= ~File not found.) "C:\Lukas\Bat\Ctx.bat %1" C:\Lukas\ConTeXt\Samples>assoc .bat .bat=batfile C:\Lukas\ConTeXt\Samples>assoc batfile batfile=Dávkový soubor pro systém MS-DOS C:\Lukas\ConTeXt\Samples>ftype batfile batfile="%1" %* C:\Lukas\ConTeXt\Samples>Hello.mkiv TCC: (Sys) Systém nemůže nalézt uvedený soubor. (= ~File not found.) "C:\Lukas\Bat\Ctx.bat %1" C:\Lukas\ConTeXt\Samples>
So it still seems to me the solution be:
(a) re-associate all (or selected) extensions which use .bat instead .exe for TC* session via a startup file in the manner
.ext = cmd.exe /c <the-original-handler>
.ext = <the-original-handler>
(b) rewrite (or add the functionality to) TC* to handle .bat in associated file extension properly, as was proposed by rconn, 2011-10-14 00:27.