I was wondering if there was a way to put something on the agent or in one the pre-existing scripts so that before every build that runs on that agent run this command whether it be a .bat or .sh script. I know you can probably use snapshot dependencies to do this but when you have several hundred builds that you want this one thing to run before vcs check it becomes an issue. The reason we are having this issue is due to the fact that when some of our builds fail it has an issue shutting down tomcat which was used for integration tests thus when teamcity goes to sync the files to the agent it has an issue due to some process is still holding onto some files thus running into a permission issue. We want to run some script that will kill these processes before each build so that the builds don't fail right away due to permission issues. Any help would be great.