As a complement to Prashant answer and to Disable close button on DOS program in Windows 7, I found some interesting elements on CodeProject Disable System Close Button on a Console Application.
If you can compile it (there are free C++ compilers all around) here is a C-C++ piece of code that you can include in your batch prior to you java program to disable the close button of the command window (this one has source and is tested ...) :
#include "windows.h"
int main(int argc, const char *argv[]) {
HWND hWnd = ::GetConsoleWindow();
if (hWnd != NULL) {
HMENU hMenu = ::GetSystemMenu(hWnd, FALSE);
if (hMenu != NULL) {
::DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND);
}
}
return 0;
}
But beware when the close button is gone you must explicitely exit from the cmd ...