LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Failed to delete file 'C:\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe'

I often see the following error during packaging:

LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.AutomationException: Failed to delete file 'C:\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe'

The file is not write protected and as far as I can see has no special permissions set (running windows 7).

Trying to delete this file lead me to the solution. There seems to be some hanging copies of this running. End-tasking or using some unlocker program to kill UnrealBuildTool.exe processes solved it for me.

This seems to happen consistently after cancelling a build from visual studio.