Windows – Explorer open a library through command line

windows 7windows-explorer

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'.

Best Answer

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