How to clear the TFS cache on client machines

Every now and again when users change the version of Tfs, the client cache will need to be rebuilt. A very easy way to initiate that process is to:

  1. close all instances of Visual Studio on the client machine,
  2. manually delete the corresponding Tfs client cache folder, and then
  3. start Visual Studio

The corresponding Tfs folders to manually delete are as follows:
Tfs 2017: "%localappdata%\Microsoft\Team Foundation\7.0\Cache\"
Tfs 2015: "%localappdata%\Microsoft\Team Foundation\6.0\Cache\"
Tfs 2013: "%localappdata%\Microsoft\Team Foundation\5.0\Cache\"
Tfs 2012: "%localappdata%\Microsoft\Team Foundation\4.0\Cache\"

 

Optionally, I have created a quick script that may help streamline things. Copy and save the following content to a .bat file, then execute on the client machine.

@echo off ECHO ********************************************************** ECHO Delete the Tfs 2017 client cache ECHO ********************************************************** rmdir "%localappdata%\Microsoft\Team Foundation\7.0\Cache\" /s /q ECHO "All Done!"

 

I truly hope this helps, cheers!