I have been struggling with this common problem, yet cannot find a good solution. I have a java process that creates a handle to a file located in the workspace, and so the next build fails not being able to delete the workspace. The slave machine is a Windows machine. I am looking for a way to force delete the workspace regardless of the running processes, and I would like that to happen in the begining of the build. Does anyone know how to do that properly? In a freestyle job? Thank you!