8

I am trying to relocate my AppData folders to free up space on my laptop's SSD drive to my much larger 1TB secondary drive.

I'm using the Location tab on the C:/Users/mark/AppData/Local to make the change and it offers to move all of the files to D:/Users/mark/AppData/Local for me.

There are a few locked files (about 6?) that I skip, and then it proceeds to make the copy, but ultimately fails with The folder can't be moved here: Failed to copy files from "C:\Users\mark\AppData\Local" to "D:\Users\mark\AppData\Local". This may be due to one or more files under the source or target folders with a fully qualified file name longer than 256 characters. The operation was cancelled by the user.

Of course, the operation wasn't cancelled by the user.

Files that were open by the system during this attempt to move:

  • UsrClass.dat
  • UsrClass.dat.LOG1
  • UsrClass.dat.LOG2
  • WebCacheLock.dat
  • WPNPRMRY.tmp
  • V01.log
  • WebCacheV01.dat
  • settings.dat
  • settings.dat.LOG1
  • settings.dat.LOG2
  • 4f37877c35670ee.dat
  • 4f37877c35470ee.dat
  • An update: I have some old MKS utilities so I ran a find to recursively print the files and filtered them to all files longer than 230 characters in length (the full path). It mostly amounted to some cache files for various things. Removing those did not resolve the problem. So I am no longer believing this has anything to do with fully qualified names being longer than 256 characters. – MarkS Aug 4 '14 at 16:26
  • If you want to save space, you might want to relocate the whole user folder. See this similar question for further details: Forcing programs to be installed to another drive – and31415 Aug 5 '14 at 14:21
7

After hours and days of research, I finally happened across a helpful YouTube video that showed how it's done.

It appears that in all likelihood, just changing the path an d letting Windows copy the files over for you is going to report an error. You will end up with files that are in use.

And this causes Windows to not complete the operation, and leave the .../AppData/Local in it's original spot. It won't change the path because of the failure.

But the trick is go right back to that dialog after the original attempt with the file copy, change path to where you want it to be (in my case from C:... to D:...), and when it asks you if you want to move the files say "No". The path is now changed.

You need to reboot the system next and you should be all set.

You'll need to clean up the original location which is no longer being used. Confirm this by looking at the properties on the folder and make sure there is no "Location" tab on the original AppData/Local folder.

After this change, I also found that windows and some apps had forgotten about a few preference related things, and I had to fix things, like my Spotify shortcut, which had hard-coded paths to c:\users\mark\appdata...

Best of luck. I hope this helps some.

1

Complementing MarkS answer, even after you manage to move everything by checking "No" when it asks if you want to move the files and you move it manually, some programs will still try to execute using the old path. This happens with programs hard-coded in the system's PATH variables, etc.

A workaround for this was to create a hard link between the old path and the new path:

mklink /J C:\Users\Lucas\AppData\Local D:\AppData\Local
mklink /J C:\Users\Lucas\AppData\LocalLow D:\AppData\LocalLow
mklink /J C:\Users\Lucas\AppData\Roaming D:\AppData\Roaming

The problem is that, to create the hard-links, there can't exist a file with that name, so you have to delete it first, and in my case some programs were locking it from deletion.

I managed unlock AppData\Local to create the hard-links by using LockHunter, a freeware utility that shows the processes locking a file/folder.

Install Lockhunter. Right click on AppData\Local -> "What is Locking this Folder?", click "Other" -> Unlock and Rename.

When you do it the first time, only explorer.exe should still be locking the folder. Then, keep LockHunter open, open the task manager (CTRL + SHIFT + ESC), kill explorer.exe and repeat the previous step (Unlock and Rename again).

Now it should work. Don't open explorer.exe yet. Instead, create the hard-link. After the hard-link is created, open explorer.exe by pressing Windows + R and typing explorer.

Now you should have all your AppData moved and without any PATH hassle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.