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!

 

Comments (4)

  1. Mehmet AVSAR says:

    Just a minor feedback: I had to change %%a to %1 in my case.

  2. Laurence White says:

    Why on earth is it not simply an option to clear cache automatically on exit, or at least make the option available from the menu bar? Any web browser allows this.

  3. Eralp says:

    I totally agree with your Laurance.. This is really bad.. Why do I have to write tons of lines script code just for cleaning cache ?This is ridiculous.!

  4. AsusT9 says:

    You may need to run this script in administrator mode.

Skip to main content