Serious problem with windows special folders

Hi. We have encountered a problem with Duplicati when trying to restore a Windows special folder (such as “Images,” “Documents,” etc.).

Here’s the issue we encountered:

  1. We create a backup of, let’s say, the “Images” folder.
  2. We attempt to restore it to the “Desktop” location.

Instead of creating a new folder called “Images” inside “Desktop,” Duplicati tries to rename the “Desktop” folder to “Images.”. In one of our tests, the computer didn’t boot again.

If we restore it to a folder named “test” inside “Desktop,” it also renames “test” to “Images.” However, if we click on “Images,” the actual name displayed is “test.” We suspect that this happens because these special folders have an “alias,” at least in the Spanish language (for example, the “Images” folder is called “Imágenes”).

duplicati

Any ideas why that happens and how to prevent it?

Thanks
Juan Carlos

Welcome to the forum @JCT

In English versions of Windows, I think you’re talking about the Pictures folder which has subfolders Camera Roll and Saved Pictures. After no initial luck figuring this out beyond it looked like Windows behavior in File Explorer (open Command Prompt and look around), I think it’s due to desktop.ini, combined with the special folders being libraries, combined with a read-only attribute on the folder…

Windows libraries
Files and folders in the Music, Pictures, and Videos libraries
Overview of the Library Description Schema

In addition to looking with Command Prompt (please try), one can right-click in File Explorer to show Filename column which (unlike the usual Name column) seems to show the real name not the “fake”. Deleting the desktop.ini file also restores right name. To see it in Explorer, use the View tab to Show hidden items. You can delete the file to the Recycle Bin, see name change, bring it back to get “fake”.

Avoiding fake name beforehand can be done by deselecting desktop.ini from the root of the folder being restored, before the restore. You can instead set dont-compress-restore-paths so that the fake name for the library goes at the end of a long path, where it actually looks fine, and does no damage.

Thanks for your answer.
If I cmd and dir, I get the right names.
If I delete desktop.ini, even if I restart later, nothing changes in my case I still get the wrong names.

I will do more tests. Thanks.

Captura

This is the error we get when we try to restore pictures into desktop. The error happens because it tries to rename Desktop and it doesn’t have admin permissions. On another computer it had permissions and it renamed it, breaking the profile and not booting again.

Which one? Assuming jc jc2 and jjj are the folders you restored to, delete the desktop.ini in one.
Alternatively do an attrib on folder. If it shows an R then give it an attrib -r to remove its readonly.

This whole idea of renaming is probably incorrect, as the file isn’t actually renamed (that I could see).
What does happen is its attributes are restored (I’m not sure that’s the best plan) so you get readonly which seems to be part of the Windows scheme for faking the name. That’s probably the error cause.

Look at the message you posted. MetadataWriteFailed is the folder attributes, not the folder name.

As a computer can have many profiles, one broken one should (I would have thought) only break one, meaning if you can get into some other that can get elevated Administrator, you can fix bad one. Also:

How to start Windows 10 in Safe Mode (9 ways)
shows some other ways that probably don’t need a working account, or even working GUI. Fix by CLI.

EDIT:

The desktop.ini file has the hidden attribute (which I mentioned above), and also system which means another Explorer customization if you want to play with file from there. It’s in View → Options → View:

image

If you prefer Command Prompt, I get varying results on whether different commands can see the file…

1 Like

You are right, my mistake, I wasn’t deleting desktop.ini inside the folders too.
After deleting it, the right name appears.

I’ll try not to restore desktop.ini next time.

Thanks.

I suppose another plan is to restore to a temporary folder and just expect folder name to change…

how Windows works with these Users Personal Folders ? says that this is also how Windows gets
localized names displayed without having to prepare the actual folder names for different localities.

[.ShellClassInfo] LocalizedResourceName=@%SystemRoot%\system32\windows
shows some lines which look very familiar from my look at desktop.ini files, especially the one from
C:\Users\<me>\AppData\Roaming\Microsoft\Windows\Libraries

[LocalizedFileNames]
Videos.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34620
Documents.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34575
Pictures.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34595
Music.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34584
CameraRoll.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34582
SavedPictures.library-ms=@%SystemRoot%\system32\windows.storage.dll,-34583

and these magic numbers were how I edited desktop.ini in my test folder to change the folder name.

1 Like