Explorer open a library through command line

3

1

It is possible to open a specific path using the explorer command line.

What is less clear is how to open one of the libraries listed in the side pane, like 'Favorites', 'Pictures', 'Desktop' or 'Computer'.

I tried simply passing those names, but that always seems to open up 'My Documents'.

Steven Jeuris

Posted 2014-03-08T15:57:54.093

Reputation: 147

1

It seems this is possible by passing CLSIDs rather than a path, looking into how to get those now ...

– Steven Jeuris – 2014-03-08T16:15:15.850

Answers

6

Opening shell folders from the command line

The folders you're referring to are shell folders, and you can't open them by simply passing their name as a parameter. A special syntax is required:

explorer shell:<FolderName>

The entire list is stored in the following registry key in Windows Vista and later:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions

Each subkey is a Globally unique identifier (GUID). The Name value is what you can use in the shell: syntax, which works regardless of the locale. See the related article below for other possible values (or just check the registry yourself).

Examples

  • Computer shell folder:

    explorer shell:MyComputerFolder
    

    You can also achieve the same result by using the shell folder GUID:

    explorer /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
    
  • Favorites shell folder (not to be confused with Internet Explorer favorites):

    explorer shell:Links
    
  • Pictures library:

    explorer shell:PicturesLibrary
    

Further reading

and31415

Posted 2014-03-08T15:57:54.093

Reputation: 13 382

The 'shell' syntax ain't working for me. The CLSID approach does. I'm currently programming a solution which looks up the CLSID. It is also important to take into account localization. – Steven Jeuris – 2014-03-08T18:01:26.543

@StevenJeuris What results are you getting? It does work for me in Windows 7. The shell: syntax works regardless of the locale. – and31415 – 2014-03-08T18:03:17.460

That's weird, now they work. Maybe it didn't temporarily since I'm messing with the registry simultaneously for the implementation I just mentioned. However, explorer shell:Favorites opens up the 'Favorites' folder in my user account folder, not the 'Favorites' star shell folder. – Steven Jeuris – 2014-03-08T18:06:55.470

@StevenJeuris The Favorites folder is a per-user folder. Even if the path looks different in Windows Explorer address bar, you're accessing the very same folder. – and31415 – 2014-03-08T18:08:50.090

Nope, I am talking about the list of 'Favorite' locations in the sidebar. The one with the star. By default it contains Desktop I believe, and if you install e.g. Dropbox it is added there. – Steven Jeuris – 2014-03-08T18:10:56.047

My user account Favorites folder contains folders like Favorites Bar, Microsoft Websites, MSN Websites, Windows Live. No idea, never used this. – Steven Jeuris – 2014-03-08T18:12:08.270

@StevenJeuris That's %USERPROFILE%\Favorites, usually located in the C:\Users\<username>\Favorites folder. You can open the folder by using explorer shell:Favorites. – and31415 – 2014-03-08T18:13:39.467

As I said, that's not the one I was referring to (when I initially mentioned 'Favorites'. – Steven Jeuris – 2014-03-08T18:14:18.247

let us continue this discussion in chat

– and31415 – 2014-03-08T18:14:35.690