0

My question is very similar to this one, but I'd like to know how the paths for libraries are defined. Similarly, I didn't see them in the environmental variable paths, nor in the App Path registry key (which makes sense, since these aren't applications that have been installed). Is there a different key that pertain to these paths?

EDIT: It looks like I've received an answer that might address my original question, only I'm not able to conceptualize or translate it into what I need actioned, so I've returned to add additional details.

The reason why I'm asking is because I've moved my library folders to different locations. By default, they are pointed to C:\users\<username>\. but seeing as how this is an M.2 SSD for me, I'd prefer not to clutter it with media files and documents, etc. Instead, I've created the corresponding directory path only on a separate drive, D:\users\<username>\.. However, it seems that whatever mechanism is responsible for pointing these libraries to their original path does not update dynamically for when they are called upon through the run dialog prompt; that is, they are still pointed to the old location. I've tested this by creating a folder with the same name at the old path and typing music or downloads, etc., will open the dummy folder. Once the dummy folder is deleted, it will simply show:

Error Screenshot

So I'm trying to understand where that path is defined in order to go in and update it myself. My apologies for not including all these details to begin with, I was expecting the answer would be a simple registry key value or such.

Arctiic
  • 1,001
  • 1
  • 6
  • 23

2 Answers2

1

I think you're looking for the values found under this registry key:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

This is where folders "required" to exist for each user are associated with file system locations.

enter image description here

Normally, these values are updated when you change a system folder's file system location via the Location tab of the folder's Properties dialog.

Opening Music from the Run dialog should open the same folder as the Music folder under This PC which should be the same folder when you type either shell:My Music or shell:Local Music in the Address bar.

If you've already deleted them, like your Videos error, re-create the folders in the default locations and then (quite possibly after you sign out and back in) the folder's Properties dialog will have a Location tab and you can then use the Move button to point them to your newly-created folders.

Keith Miller
  • 8,704
  • 1
  • 15
  • 28
0

Windows uses a Quick Access approach for File Explorer and so just uses the real folder for finding file contents.

Since this is part of the File Explorer App, there is nothing additional to put in the Environment Variable or in the Path.

This applies to numerous folders within the File Explorer App.

Libraries (in your Question) are a Quick Access folder (not a system folder) pointing to the items in the Library (normally Documents, Pictures, Photos and like). Libraries are not heavily used in my experience.

If you look in some non-Windows File Managers (I use xPlorer2) Quick Access does not show.

Regular folders (not Quick Access type) are in the Path. Any folder needed for the RUN command to work, will be in the Path.

So I'm trying to understand where that path is defined in order to go in and update it myself.

If you change the location of Documents and like folders using the folder properties in Windows File Explorer to another drive, the Environment should change with it.

Windows Quick Access

.

Here is an excerpt of path showing regular Path variables.

Windows Path Excerpt

John
  • 46,167
  • 4
  • 33
  • 54
  • I don't understand the relationship with QuickAccess. The run dialog uses a simple command [ShellExecuteEx()](https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecuteexa) going way back to the 9x days. The behavior has nothing to do with the explorer persay and predates QuickAccess by 20 years. Windows first looks in "." (current directory), then hunts the path (as you said) but again, has nothing to do with explorer. This is the same function as when you call `start` from the command line. – Señor CMasMas Jan 05 '23 at 23:38
  • Quick Access is part of File Explorer. It does not use the Run Command. So the QA icons are not part of Path because the real files (if Windows files) are part of Path. That is why I showed the relevant path excerpt. I used a new OS to demonstrate (Windows 11 which works very similarly to Windows 10) – John Jan 05 '23 at 23:41
  • "How does the windows run dialog locate system directories" .. I am still partially confused as to how this answers the question. You are very smart and a golden contributor to this site so I will simply assume that I am not getting it. Thanks for the response. – Señor CMasMas Jan 05 '23 at 23:46
  • Run uses the Path and if the relevant system folder is in the path , the Run command will run. Path includes all the required system folders to work properly. Libraries are a QA folder, not a system folder. I will clarify that – John Jan 05 '23 at 23:50
  • I have tried to take all your thoughts (all good) into account in my answer – John Jan 06 '23 at 00:17
  • I have edited the OP to include more details and what I'm trying to resolve, which should give more specific context to my question. Apologies for not doing so to begin with, I was expecting a simple registry key or such as the answer, my bad! – Arctiic Jan 06 '23 at 00:53
  • Folder Paths are in the Environment and I included a screenshot to show you. But that does not include in built stuff like Libraries which are not in the Path but do show up in Quick Access – John Jan 06 '23 at 01:03
  • @John I'm not sure I follow. I did check Environment but did not see any entry that seemed relevant to this case. You're saying Libraries are "not in the Path", but in fact there is *some* sort of mechanism that is redirecting run dialog prompt entries to open these directories. If it isn't in the Env Path, my expectation was that it'd be in the registry somewhere instead similar to App Path. – Arctiic Jan 06 '23 at 01:31
  • Libraries are kind of an app in File Explorer and not in the Path. I do not use the registry for path and neither would most people – John Jan 06 '23 at 01:34
  • @John Yes, I understand that part. What I'm saying is, when you open Run dialogue and type in `videos` or `pictures` or `downloads`, the system will still open the respective directory. I need to know what/where/how the system is defining that associated between the shortened input to the full directory path, because updating the Library locations does not update where the Run dialogue is looking. – Arctiic Jan 06 '23 at 01:37
  • Use the folders within the library to access via the Run Command. – John Jan 06 '23 at 01:39
  • @John Could you perhaps demonstrate or provide a more verbose, procedural explanation? Because for me, invoking Win + R, inputting "videos", and pressing Enter will open the respective folder through Windows Explorer when the folder exists *in the default path* only, but it does not when that path is relocated somewhere else (and I apologize if this is an issue of my vernacular usage causing confusion here, but I will either capitalize or codify `Path` when referencing the `Env Path` going forward). I'm not sure what you mean by your previous comment? – Arctiic Jan 06 '23 at 01:45
  • I assume your Environment is "normal" When I Win+R Documents, Pictures, Videos, these folders open. That is what I meant by folders within a Library. Why would you move such Environment Paths somewhere else? That will make things not work. I assumed a native Windows Environment in my answer – John Jan 06 '23 at 01:51
  • @John Seeing as how the relocation of these directories is itself a **native** Windows feature (Ctrl+Enter the folder in question, and refer to Location tab), I don't understand why keeping the "link" alive would be outside of your expectations? As I explained in my updated answer, my OS is installed on an expensive M.2 SSD with limited capacity, and I do not wish to "wear" it down with media files and documents, which I'd rather store those on my regular SSD. – Arctiic Jan 06 '23 at 01:57
  • I have been using SSDs for years (6 years on my first Lenovo X1), You do not wear out a good SSD using files. You can use Windows to Relocate Documents, Pictures and so on to another drive. That should change your Environment path but I have not test that. My answer covers the basics of Native Environment, Path, the Library App and folders inside that. It does not cover the myriad of possibilities. Still as a "standard answer" I think it covers your main points. – John Jan 06 '23 at 02:03
  • I added the Document Property change to another drive to my answer – John Jan 06 '23 at 02:08
  • @john I recently had two of my SSD's hit the end of their lives, so I'm likely a little oversensitive from the loss. Not to mention, I know prices have dropped on the Samsund Evo M.2's, but I had bought it pretty early on around when it was released, so the loss aversion bias is strong for me, haha. Regarding your updated answer, yes, that is the *expected* behavior I had anticipated but for some reason it isn't happening on my end. I've just noted though you mentioned they should be in registry, so I'll take another look when I get back to my workstation. Thank you! – Arctiic Jan 22 '23 at 08:43