So today wasn’t my best day for decision making. I had a user whose PC was set up with offline files through Windows Sync Center. This is all well and good except a group of files weren’t actually synced with the server. I realized this so I went in to the conflict section of sync center and forced it to put the files on the server. In my haste to finish up this problem and move on to the next, I didn’t double check the actual server to ensure the files were there prior to disabling offline files. Of course given my luck, as soon as offline files are disabled all the files disappear. So now I’m looking at a disgruntled client who believes I just lost hours of work and I’m wondering to myself how to recover them. After a considerable amount of time scouring the web I didn’t find any cut and dried instructions on how to solve my problem so here is the solution I used:
1. Prepare the client for the worst.
2. Pray that Google has the answer and start searching.
3. Open a cmd prompt as administrator
4. Change directory to C:\windows\CSC\
5. Run a takeown command to give the local admins group owndlership of all the files in that directory. This command will grant ownership of all files and folders to the local admins group: takeown /A /R
6. Wait for takeown to process all of the files in the directory. For me this process took about an hour.
7. Once takeown has finished you should be able to browse the folders and find your lost documents. If the file wasn’t cached it will show up as a 0 KB file. If it was you will see that it has a file size greater than 0.
8. Now that you have ownership of the files you still must grant your account full access rights to the file in order to move or copy it. If you are trying to recover a lot of files this is best done using the cacls command. I was only recovering a few so I did not want to waste the time getting my syntax right.
9. Copy or move the files to a location of your choice.
A lot of work for a few files, but whatever the client needs right?