Or, you could write a program that uses the EnumWindows() routine to enumerate all windows, and for each window call
GetWindowThreadProcessId, and then use the resulting ProcessID in a call to GetModuleBasename, and after determining that the window belongs to CMD, proceed to use OpenProcess() and ReadProcessMemory() to determine the opened file handles of the CMD.EXE instance, and if you find your batch file, kill the current instance and otherwise continue.
Really quite straightforward really. Although I suppose Openprocess() will fail anyway, and ReadProcessMemory() is a fairly big gamble on pretty much any NT system. Oh well.