02 December 2011

Move Offline Files in Windows

Windows offline files work well for me but  I wanted to move the folder to a different disk which isn't an option through the GUI. I eventually found an answer that worked for me courtesy of Shaun62L and Brian.bsi so thanks to them:

The process outlined wasn't exactly right for me so I have summarised what I did for my own notes and in case that source should move or disappear. Note this only seems to work on NTFS disks.

To move the location of offline file store (Windows 7):
  • Go to Control Panel\All Control Panel Items\Sync Center\Manage Offline Files and click Disable Offline Files
  • Reboot
  • Delete the old cache. You may struggle a bit here as for me it did the old trick of hanging on to the permissions even after I set them but I found if you persevere I was able to eventually.
    Open cmd.exe as administrator (Start, type "cmd" then press Ctrl, Shift, Enter) and take ownership of the files:
    • On the command line:
      takeown /f c:\windows\csc /r /d y
      icacls c:\windows\csc /grant administrators:F /t
      You could make this a .bat file by substituting %1 for the path and calling it like so:
      takeown.bat c:\windows\csc
      This will go through all the files and set permissions, it may take a long time.
    • Using Explorer. (NB you may need to drill down into the folders and repeat this for each folder depending on your file/folder structure and permissions):
      • Right click the folder and select Properties, Security, Click Advanced and Choose Owner tab.
      • Choose Edit and select yourself in the list (or click Other users or groups to add)
      • Tick Replace owner on subcontainers and objects, Click OK to exit
    • Run: del /S /Q c:\windows\csc to delete the folder and subfolders. 
  • Make the new directory: mkdir D:\CSC
  • Run the command: mklink /d "C:\Windows\CSC" "D:\CSC" to create a symbolic link to the new location
  • Re enable Offline Files
  • Reboot

No comments:

Post a Comment