Do you know the Windows shutdown process is implemented? Does it has some criteria to avoid inter-process communication problems between child and parent processes?
This question originated from an suspicious (apparent) coincidence situation on a script terminating successfully and shutdown of the machine [over-described on the original written question replied by Falcon Kirtaran].