We run several simple python scripts periodically on our servers using Windows Task Scheduler. The scripts are extremely simple, and grab statistics like the Disk Space and the CPU Percentage and log them.
Occasionally we notice we cannot edit, rename or delete the script. When we look in the task manager we see that the script has finished successfully, but there are one or two instances of taskeng.exe still lingering.
We have searched high and low trying to see if there is a way we should be exiting our python script to prevent this, but it only seems to happen 1 in 100 runs of the script, which makes us think it's a Task Scheduler issue.
Someone has suggested that we just kill taskeng.exe when our script is done, but this seems like a sledgehammer solution ( and we sometimes have two scripts run at the same time. )
Hopefully someone here has come across this issue before!