|The only way I know to do this is through a little C/C++.|
There is a problem though, there seems to be a bug in the API,
you can disable the menu item but <alt>+<space> or clicking on
the cmd icon re-enables it, so the only sure way is to delete
the menu items(which unfortunately stays deleted on that console
window until it is closed via "exit", killing with the task
manager or the batch finishing).
This will also only work for win2000 and above. It also
does nothing about ^c.
#define _WIN32_WINNT 0x0500
DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
Here is a complied executable, just add "noclose"
to the top of the script(with the executable either in the
same dir or a path dir).
It's up to you to decide if it will solve your problem or not.
Another option may be to use a utility like nircmd to make the script
"hide" itself until it's finished processing.
There is really no way to do what you want without some
sort of utility(or using vbs as mentioned above)....
Batch Variable how to