Spider
Spider

Reputation: 983

ShellExecute to open a special folder (ex: "Libraries\Documents") without knowing the special folder name

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

Upvotes: 0

Views: 2344

Answers (1)

Andrew Lambert
Andrew Lambert

Reputation: 1909

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.

Upvotes: 1

Related Questions