0
votes

I'm making an application to backup the opened folders. The problem is that if in that folders are some special folders (ex: "Desktop", "Computer", "Libraries\Documents", ...) they will not open.

I know that there are constants for those objects, but I don't know which folders will be opened so making a dictionary with all SpecialNames => SpecialConstant is not a good solution for me.

So the question is: Is there any WinApi function to retrieve the full path from a short name of a special folder?

P.S. Tried both ShellExecute("open", "Path") and ShellExecute("open", "explorer.exe", "Path") If you paste the names in the explorer they work, but opening them from C++ doesn't work

Thanks

1
These are virtual folders, provided by a shell namespace extension. There's no point in backing up virtual folders, focus on the real file system directories on the disk.Hans Passant
I need to reverse them so I can open them when the user needs to.Spider
Then I believe you're going to have to construct a table of virtual/actual paths.Carey Gregory
yeah, that's the harder way, because of different versions of windows, etc. I'll wait for some days maybe somebody will suggest something, and then I'll go with the table. :)Spider

1 Answers

1
votes

Libraries are stored in the users %appdata%\Roaming\Microsoft\Windows\Libraries directory as XML files with the names <libraryname>.library-ms (e.g. Pictures.library-ms.) Opening one of these files with ShellExecute opens an Explorer window and shows the library.