I have an occasional wacko problem involving FireFox and VeraCrypt (or maybe any long running command). I have no idea how to debug this.

I have a .bat file containing a VeraCrypt Mount command. The command prompts for a password, then displays a "This may take a while" type message and runs for about 10 seconds. Several times- 3 or 4 - in the past week the command window has stayed open after the mount has completed. I have had FireFox running each time this has happened, and each time FireFox has hung; it loses focus and cannot be brought to the foreground. Process Explorer shows 4 or 5 Firefox processes. After killing them and restarting Firefox it works as though there had been no problem.

Two basic things I failed to check:
  1. I did not check to see if any FireFox processes were using cycles (but I think I would have noticed if one seemed busy).
  2. I did not check for any events.

This may be happening on two PCs but I can remember only one for sure. Both PCs are running Win10 1803.