Reset and reinitialize Offline Files cache in Windows Vista/7


To totally unlock this section you need to Log-in


Login

Offline files in Windows are a set of features that essentially give users the ability to work with files off of or outside of the network. So for example if a user had a laptop that had a mapped drive or network share and were to take their computer outside of the network, the features offered by offline files would allow this user to continue working with these files.

These settings can of course be controlled on a per-user basis by changing the settings and configuration of the “Sync Center” tool in Windows. But when you are involved in a larger environment and need this sort of process automated for many users, Group Policy becomes the most effective way to handle this problem.

There are a few steps to get offline folders disabled correctly so I thought I would share all the pieces in case somebody runs across a similar need as I did. The first step to disable the offline file features is to adjust the following settings in Group Policy:

Computer -> Policies -> Admin Templates -> Network -> Offline files

  • Allow or Disallow use of the Offline Files feature: Disabled
  • Prohibit user configuration of Offline Files: Enabled
  • Sync all offline files when logging on: Disabled
  • Sync all offline files before logging off: Disabled
  • Sync offline files before suspend: Disabled
  • Remove “Make available offline” command: Enabled
  • Prevent use of Offline Files folder: Enabled

Next, we need to tell Group Policy to shut off the offline file service and disable it on all Windows machines that have the service installed (Windows XP, 7, 8 machines). To do this you will need to modify your Group Policy settings on a machine that has the service installed it already, through RSAT.

This is an important step, you will not be able to find this service if you are adjusting the GP settings from a server. This service is located in the following location:

Computer Configuration -> Windows Settings -> Security Settings -> System Services

The specific service we are looking for is the “cscservice“, which corresponds to the service labeled “Offline Files” in the Windows services list.

The last step to get this policy working correctly is to add in a registry key that will fix machines that have already been used to cache certain network resources.

Essentially adding this registry key tell the machine to blow up its database of offline files and tells the machine to remove the cached files as well. To configure this settings we need to add in a custom reg entry:

Computer Configuration -> Preferences -> Windows Settings -> Registry

Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\CSC\Parameters
Value name: FormatDatabase
Value type: DWORD
Value data: 1

Reset and reinitialize Offline Files cache in Windows Vista/7

Reset and reinitialize Offline Files cache in Windows Vista/7

This registry key is also useful when you only want to reset Offline Files; sometimes you just have too many conflicts when synchronizing your offline files in Windows 7 that you have to start over, but gone are the days of CTRL+SHIFT and clicking the Delete Files button in “Folder Options” like you did back in Windows XP to clear out the CSC (Client Side Cache) folder. Well, here’s how I’ve discovered how to clear the cache and start over.

Registry Method

Make sure that your files and folder have been synchronized. Reinitializing the cache prior to synchronizing will cause you to lose any data that isn’t synchronized.

Reset and reinitialize Offline Files cache in Windows Vista/7

Reset and reinitialize Offline Files cache in Windows Vista/7

Click Start, type regedit in the Start Search box, and then press ENTER.

If you are prompted for an administrator password or for a confirmation, type the password, or click Continue.
Locate the following registry subkey, and then right-click it:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\CSC 

  • Point to New, and then click Key.
  • Type Parameters in the box.
  • Right-click Parameters, point to New, and then click DWORD (32-bit) Value.
  • Type FormatDatabase, and then press ENTER.
  • Right-click FormatDatabase, and then click Modify.
  • In the Value data box, type 1, and then click OK.
  • Exit Registry Editor, and then restart the computer.

Another quick way to change the FormatDatabase value in Windows Registry is the following: in an elevated command prompt window, type in the command below and press Enter:

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Csc\Parameters /v FormatDatabase /t REG_DWORD /d 1 /f
Reset and reinitialize Offline Files cache in Windows Vista/7

Reset and reinitialize Offline Files cache in Windows Vista/7

Now restart your computer so that new effects can take place over Offline Files cache.

Enjoy :-)