How to copy user's appdata folder using robocopy?

2

I'm trying to backup my current user's AppData folder.

Because the folder is quite big, I wanted to use robocopy.

However, robocopy is having mess with symbolics links.

Especially, in the user folder, there's a symbolic (I guess) link named Application data and that points to Roaming folder.

There's also within the Local folder, another link named 'Application data' that points to local folder. This ends with a recursive infinite loop local\application data\application data\application data and so on, each time copy the whole local folder.

I tried to add the /sl switch to robocopy, without success.

How to properly copy my user folder ?

Steve B

Posted 2018-07-06T09:46:26.727

Reputation: 1 580

You can try xcopy with /b option. – Sandeep – 2018-07-06T10:00:11.337

Do note, these symbolic links are there for backwards compatibility. If you are only interested in a backup, not a functional profile, you can ignore these links alltogether. – LPChip – 2018-07-06T10:18:19.077

@LPChip The AppData folder doesn't contain a symbolic link named "Application data", that would in the user profile itself as far as I know and also only should be pointing to the roaming part of the AppData folder. It wouldn't make sense for backward compatibility as the AppData structure didn't exist before (No AppData\Local, AppData\LocalLow and AppData\Roaming). – Seth – 2018-07-06T10:38:56.873

Answers

4

I've had good results copying the User folder using the /xj switch.

David Marshall

Posted 2018-07-06T09:46:26.727

Reputation: 6 698

1Yes /xj is the correct switch to exclude junctions (aka symbolic links), which is what is in the user's profile folder by default. I use it all the time for exactly this purpose. – BeowulfNode42 – 2018-07-06T12:15:37.510