Relocating the Client-side Caching database in Windows 7 and 8

Sometimes the default location of the Client-side Caching database is just plain unsuitable. Client-side Caching, or CSC, is used for storing offline files, local copies of files normally stored on Windows shares, stored on Windows servers. (The Norwegian term is «frakoblede filer».)

The default location for the CSC database is C:\Windows\CSC. If you like to keep the OS and the software separate from any user data, or want to store the CSC database on a dedicated local partition, then it might be useful to change the location to, e.g. D:\CSC.

I found a detailed recipe on the net, but soon found out the recipe was contradicting itself at one point and I decided to write something shorter:

  1. Log in as a user with administrative rights, e.g. the local Administrator account.
  2. Create the directory to be used by the new CSC database, e.g. D:\CSC.
  3. Run regedit.exe and navigate to:
    1. HKEY_LOCAL_MACHINE
    2. System
    3. CurrentControlSet
    4. Services
    5. CSC
    6. Parameters
  4. Add a new DWORD named FormatDatabase and set its value to 1 (the digit one). This DWORD forces Windows to erase/reinitialize the current CSC database. The DWORD will be automatically removed once the CSC database is ready.
  5. Reboot the computer.
  6. Log in as a user with administrative rights.
  7. Run regedit.exe and navigate to:
    1. HKEY_LOCAL_MACHINE
    2. System
    3. CurrentControlSet
    4. Services
    5. CSC
    6. Parameters
  8. Add a new string named CacheLocation and set its value according to this format:
    \??\Drive:\Folder
    That’s one backslash, followed by double question marks, followed by another backslash, followed by the drive letter in question, followed by a colon, followed by a third backslash, and finally add any pathname relative to the root directory of the drive in question. Note, this should be a drive letter for a local drive/partition, otherwise you’d defeat the purpose of offline files in the first place. The use of any root directory should be avoided at all cost.
    E.g. \??\D:\CSC

  9. Reboot the computer.
  10. The old CSC database is now just an empty CSC database and may be left in place. A new CSC database will be established at the selected location.
  11. Log in as any normal user and (re)establish the use of offline files.