≡ Menu

Delete Offline Files Cache Windows 7

In Windows 7 there is no user interface to delete Offline Files cache (CSC cache).  The only way to delete cache is using registry key. Detail steps are given below.

  • Open Registry editor (Execute Regedit from Run window)
  • Go to this key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters
  • If Parameters key does not exist under CSC you can add it.
  • Now in the Parameters node create a new registry value with the name FormatDatabase of type REG_DWORD (i.e DWord 32-bit value)
  • Set the data in this new registry value to 1.
  • Close registry editor
  • Reboot the machine

The above steps can only be done from an administrator’s account. We can do the above steps from command line too. For this you just need to run the below command from elevated administrator command prompt.

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters /v FormatDatabase /t REG_DWORD /d 1 /f

If you run the above command from normal administrator command prompt you will get “Error: Access is denied” message.

Note that 'Delete temporary files' button under the 'Disk Usage' tab in  'Manage Offline files' window is not meant for deleting offline files cache. Some people have the misconception that this deletes offline files cache. This is not true.

{ 22 comments… add one }
  • Anonymous August 25, 2011, 8:21 pm

    Worked, thanks for posting!

  • Anonymous December 29, 2011, 3:11 pm

    this worked perfect. any idea how these files get corrupt on a single domain machine?

  • Anonymous February 15, 2012, 11:04 pm

    Worked Brilliantly thanks!

  • Anonymous February 24, 2012, 8:02 pm

    should i still be seeing folders in c:windowscscv2.0.6namespaceservershare after i do this on a client?

  • Anonymous March 30, 2012, 3:53 pm

    This worked great! I have had this issues for weeks – nobody could resolve!

  • Anonymous May 16, 2012, 10:20 pm

    How can you recover lost files after you do click 'delete offline copies' and then run this in the registry?

  • Anonymous June 12, 2012, 10:53 am

    Didnt work for me – where isthe actual folder located? – you can actually manually delete it but I cant find it…

  • Srini August 22, 2012, 4:51 am

    Actual folder can be found @ C:WindowsCSC

  • Richard Andrews November 7, 2012, 11:15 am

    I just deleted the v2.0.6 folder within CSC to solve my problem. after a reboot the folder is recreated and offline file will be saved again.

  • Anonymous January 31, 2013, 8:25 pm

    FYI people the CSC cache is a database not a set of folders containing the files. This database becomes corrupt due to a large number of reasons, but usually based on having too many files and the database being closed mid-sync. I.e. computer crash or sudden restart. Though i've had to reset the cache to just get offline sync working the first time.

    As for the person looking to recover files after resetting the cache. Good luck, you are trying to recover something you've purposfully deleted. Always try and recover the files before doing something destructive. If you are lucky perhaps the files are still on the server or may be available as part of the servers "Previous Files" volume shadow copy.

  • Anonymous March 26, 2013, 4:10 pm

    After doing your steps I still found my offline cache here in c:windowscscv2.0.6namespace

    I removed them by hand.

    In spite of your method work fine! Thanks

  • galacticpresident July 17, 2013, 3:36 pm

    does that registry entry need to be removed after a reboot or I just leave it there?

  • Denis Chang July 24, 2013, 11:52 am

    this perfectly fixed my issue after I've struggled and tried all other method including clearing CSCnamespace…..

    thank you so much!

  • Anonymous August 14, 2013, 4:26 pm

    Thanks so much. it worked.

  • Anonymous August 16, 2013, 8:41 am

    That has been very helpful. It worked perfectly for me. Thank you very much.

  • Brad December 11, 2013, 2:30 pm

    Does that regestry need to be removed after reboot? I am also wondering this…

    What exactly does it do? Will it clear the cache everytime I reboot?

  • Brad December 11, 2013, 2:33 pm

    Ah, sure enough it deletes itself automatically. Found a note about it on here: http://support.microsoft.com/kb/942974

  • mrg October 12, 2015, 1:25 pm

    CORRECTION
    Reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters /v FormatDatabase /t REG_DWORD /d 1 /f

  • Chad December 8, 2015, 6:49 pm

    Then what is the “Delete temporary files” button on the Disk Usage tab of the Manage Offline Files window for, if it isn’t a user interface to delete the Offline Files cache? And if it isn’t meant to delete the Offline files cache, why is it on that page and what does it do? What you said seems to be contradictory to what is, in Windows 7.

  • Randal Voige April 18, 2016, 5:43 pm

    THIS WILL DELETE ALL CACHED OFFLINE FILES – DATA WILL NOT BE RECOVERABLE, ENSURE YOU HAVE BACKUPS IN PLACE.

    Microsoft’s Notes :

    Make sure that files are synchronized before you add this registry entry. Otherwise, unsynchronized changes will be lost.
    The actual value of the new registry key is ignored.
    This registry change requires a restart. When the computer is restarting, the shell will re-initialize the CSC cache, and then delete the registry key if the registry entry exists.

    Windoes 7 Reference : http://support.microsoft.com/kb/942974

  • Dave June 26, 2016, 6:43 am

    “CurrentControlSe” – A truncated string wont work that well, please edit the article – very easy to overlook this when you are just googling fast to copy the string. (yes i am lazy)

  • Pietje Puk October 10, 2016, 6:27 am

    Thank you! That was very helpful.

Leave a Comment