by Andreas

Team Foundation Server – Folder Locked for Check-Out

imageWhile doing some reorganizing in a client’s TFS structure I came across a common problem: files or folders are locked by a user that is no longer available. The error message says:

The item [file path] is locked for check-out by [user] in workspace [workspace]


In my case the files were locked by a user account from my previous Windows Server 2008 R2 image. To unlock all files for a given user account, open up the Visual Studio Developer Command Prompt (located under your Microsoft Visual Studio 20xxVisual Studio Tools folder). Run the following command, replacing [workspace] and [user] with your values:

tf lock /lock:none /workspace:[workspace];[username] /recursive $/


Note: You have to have Project Administrator or Team Foundation Administrator rights in order for this to work.