Windows – The compression cannot be performed because the path to the file or directory ‘Application Data’ is too long

compressionwindows 7zip

In Windows 7, whenever I tried to compress the USER directory into a .zip file I experienced this error and cannot continue:

The compression cannot be performed because the path to the file or
directory 'Application Data' is too long.

Is there any way to compress the USER directory?

Best Answer

The problem is that "C:\Users\Administrator\AppData\Local\Application Data" is a NTFS junction point that points to "C:\Users\Administrator\AppData\Local". This causes an infinite loop in programs that do not specifically check for junction points.

Wikipedia actually mentions this very issue: http://en.wikipedia.org/wiki/NTFS_junction_point#General .

You should look for an archiver that understands junction points and has the option of not following them.

As a last resort, you can try temporarily deleting the junction point. But be careful, if you try to delete the folder as usual, you will end up deleting what it points to. And you may temporarily break stuff that relies on the junction point. The delection can be performed with (according to http://support.microsoft.com/kb/205524 ):

cd "C:\Users\Administrator\AppData\Local"
linkd "Application Data" /d

However, be aware that the junction point will then not be archived and will not be recreated when you extract the resulting archive.