0

I am trying to automate our project's directory and I thought that setting up aliases could help a lot. They need to be accessible from anywhere and, ideally from the Windows File Explorer Address Bar. I see that some just typing names of some common directories like "desktop" or "program files" doesn't need some "shell:Desktop" or "%Desktop%" special formats, which helps a lot. But how is that set up? Are those folders hard-coded to be accessible this way? Is it Windows Index, some special env var?

And most importantly can it be changed from "userspace"?

Do Group Policies have such a "feature"? Puppet/Ansible/Chef...?

EDIT: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders does NOT work. I think they only take "shell:xxx" format

2
  • You might use Windows Explorer Libraries, or use Regedit to create your own system folders... see technospot.net/blogs/… Nov 24, 2020 at 2:35
  • hmm thanks, but I don't want to create new folders, but create aliases to existing ones, mostly shared network folders. Nov 24, 2020 at 12:57

2 Answers 2

0

I think there are two categories of folders that can be accessed by simply typing their name in the Address bar. A few System folders seem to be hard-coded:

  • Program Files
  • System32

When either of these folder names are typed in the Address bar, the corresponding file system location opens:

enter image description here

But when you type "Desktop", it's not This PC > Deskop or This PC > Windows (C:) > Users >UserName> Desktop (two different Namespace paths that refeence the same file system folder) that opens, but rather the Virtual Desktop, which is the root of the Shell Namespace. It's an aggregate of two file system locations:

  • shell:ThisPCDesktopFolder
  • shell:Common Desktop

and two registry keys:

  • HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace

where junctions to file system locations ( OneDrive, shell:UsersFilesFolder) as well as virtual folders such as Network, Control Panel, and Libraries are added. The easiest way to view all sub-folders of the Desktop is the DropList displayed when you click the leftmost breadcrumb control in the Address bar:

enter image description here

Any name you find in this list can be typed in the Address bar without any special syntax. So any folder located in either of the two "Desktop" folders gains this functionality. With all of these values, there's nothing mysterious --- as top-level sub-folders, the folder name is also the fully-qualified namespace path.

In addition to the immediate sub-folders of the Desktop, it appears this functionality is also granted to the locations found under This PC: User folders, Devices and drives, and Network Locations can all be directly accessed by typing the container name in the Address bar. While adding folders that appear alongside the default user folders is possible, it's somewhat labor-intensive, requiring creation of a GUID and multiple registry keys for each folder you create. The Network Location functionality is much easier. Although the Add Network Location wizard will balk if you try to enter a local path, you can bypass the wizard. Any item ( folder, file, shortcut ) present in the folder accessed via shell:NetHood will appear in the Network Locations group:

enter image description here

enter image description here

4
  • So if I understood correctly there is no way to add new "shortcuts" like those, that is they are indeed hard-coded? Nov 24, 2020 at 13:01
  • I don't know how you would create ones like "Program Files" or "System32", but you could create folder shortcuts like the Add Network Location wizard does. You would have an entry under Network Locations for every shortcut created, but they can reference any location. Nov 24, 2020 at 13:13
  • I know what you are saying, but if I had hundreads of shortcuts that would get cluttered. I think it may be error-prone as well in some unexpected way. Means that creation and deletion of these shortcuts needs to be scripted whenever we change project... not sure, but it sounds buggy. As I mentioned below there is a way of accessing any path from the "PATH" eenvironment variable, which I find much cleaner... it's just a plain text, which can be easily loaded and unloaded for each project. Also it's guaranteed to work without administrative privileges? Nov 24, 2020 at 13:17
  • Hundreds of folders wouldn't seem to lend themslelves to individual shortcuts regardless of the creation method. I would imagine one shortcut-enabled folder, for example, "MyProject", that serves as a "directory" or collection of shortcuts or junctions ot your projectfolders. Also, I don't think any of the shell: locations, ThisPCDesktopFolder, Common Desktop, or NetHood, require Administrative access. Nov 24, 2020 at 18:32
0

As Keith Miller explained there is no way to add aliases other than a few existing locations.

EDIT: This could be achieved, by creating shortcuts in one of those hard-coded locations, though.

EDIT2: Come to think of it creating a "Shortcuts" folder ON a "path" evn var and then dropping links there isn't much different from Keith's advise... with a small difference that it's a separate folder (cleaner).

Buuut what did work for me is WinKey+X prompting "Run" dialog and there typing names from the "PATH" environmental variables does work. I would expect this to be also available in the Explorer's Address Bar, but still it's not much more hassle this way.

It's extendable and I think I will be able to save different "Path" values in text files (I still need to think through how exactly to do it) and load them depending on a project.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .