Summary
I have seven Windows batch (*.bat) files running continuously on Windows Server 2008 R2. These files simultaneously run into an issue on a recurring basis that causes their cmd.exe (Windows Command Processor) windows to require me to repeatedly press the Enter key in order to continue processing. A system restart is required, since restarting the batch files doesn't change the issue.
Does anyone know of any quirks of Command Prompt that might cause this behavior, or a quick fix that would allow me to work around the issue when it occurs, without having to do a full reboot?
The process, running as normal
The .bat files are running in order to watch for files to appear in specified folders. Once those watched files are seen, code in the .bat files acts upon the watched files. All the while, the .bat files are each printing comments to their individual displayed Command Processor windows in order for me to track their progress as they continue to run.
The issue
Intermittently, something causes all of these .bat files to hang, and all newly started .bat files will have blank Command Processor screens. The strange part is that I am able to advance each of the .bat files by clicking into one of their Command Processor windows and then pressing the Enter key on my keyboard, but Enter has to be pressed constantly to get the .bat file to continue as normal, as it appears as if the .bat file only advances by one printed Command Processor line with each press of the Enter key. This feels as if it is an issue that occurs at the Windows Server OS level, since it impacts all running and newly-opened cmd.exe windows at once.
Solutions, temporary or otherwise
The issue is temporarily resolved by restarting Windows. I hope someone knows of a quick fix with cmd.exe that could allow me to fix the issue when it occurs without restarting. Something like restart certain Windows Services?
I asked ChatGPT about the issue. https://gist.github.com/MrChozo/71327058b4182e4ceeec4b6ec389cbc1.
Its proposed steps are good, but a quick fix would be nice until I can devote time and some of my company's very limited resources to an OS upgrade.