This morning builds started failing in our TFS 2010 server due to a file being in use. It turns out that the file was being used by the backup process, god knows why they were backing up the build area but that is by the by.
After a lot of recommendations about different software, I found this post, which suggests using Process Explorer from Sysinternals, which was exactly what I needed as it was already in the server.
In this example I just used PowerShell to create a new instance of StreamWriter, which writes to a file called test.txt, thus creating a locked file, but the idea is the same for
any locked file.
- Start Process Explorer.
- Press Ctrl + F to look for handles on files.
- Enter the name of the locked file.
- Double click on it, which will take you to the file handle itself.
- Right Click on it and select Close Handle
- Click Yes.
No comments:
Post a Comment