Location:
State:
Carrier
Country
Status

Improper resolution of Documents folder?


I have used the Location tab on the Documents folder to move my folder to 'J:Documents'.




In the registry I see these two keys:


Code:
[HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerShell Folders] "Personal"="J:\Documents"   [HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionExplorerUser Shell Folders] "Personal"=hex(2):4a,00,3a,00,5c,00,44,00,6f,00,63,00,75,00,6d,00,65,00,6e,00,   74,00,73,00,00,00
However, when I use the expression %USERPROFILE%Documents it always expands incorrectly:


Code:
Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation. All rights reserved.   C:WINDOWSsystem32>cd %USERPROFILE%Documents   C:UsersJimDocuments>
What could I be doing wrong?

I suppose the resolution of %USERPROFILE% is fixed and not context-sensitive, so how should this be expressed for a shell file?

There could be a couple of reasons.

When you move your Documents folder to another Drive, you are presented with a Popup window that asks if you want to move the contents. If you don't select yes, you can end up with your Documents in both places.

There is a hidden documents folder which cannot be oved as it is basically a pointer. It holds no documents, it only points to where your documents actually are. Many programs use your documents folder by default. If you move them from the default location, something has to tell them where they are now.

In the same vein, there are a very few programs which are coded to put their files in C:UsersUsername]Documents. If you have moved them, the program will create a Documents folder in C:Users.

If you will go to File Explorer and right click the Documents folder and select properties, it will tell you where your documents actually are. As you can see, mine are on my E drive.


There could be a couple of reasons.

When you move your Documents folder to another Drive, you are presented with a Popup window that asks if you want to move the contents. If you don't select yes, you can end up with your Documents in both places.
...
Mine are on the J drive.



I did a full move of all the files when I made my user folder (probably on Windows 7). I have updated in-place from 7 to 8 to 8.1 to 10.

Several of my programs installs made folders on the fixed location 'C:UsersJimDocuments'.

So I do have some stuff there, but most stuff in the proper location.

However, that does not answer my question about the expansion of the Userprofiles nor how to programs actually locate the correct place.

This all seems very sloppy to me.

I guess I am basically asking how does one programmatically find a user 'Documents' folder?

By the way, 'shell:Personal' resolves properly.

I decided to create a junction in C:UsersJim called Documents and pointed it to the true location.
Things seem to be OK now.

I decided to create a junction in C:UsersJim called Documents and pointed it to the true location.
Things seem to be OK now.
Previous versions used to do that for you when you moved the folder(s) through properties > location.

Windows 10 has implemented a new method of movingthe special User folders in Settings > Save locations. This change seems to have affected the properties > location method in that the junction is no longer created.

essenbe alluded to the junction in his post and you created one manually so the issue is resolved. I don't know if I would characterize this as a bug though - probably.

I've been on too many versions of Win10 to be absolutely certain the above is factual, but I noticed the same behavior on my machines when I did a Clean install (therefore, no junctions were carried over from an upgrade)

Good troubleshooting arachnaut.

Well, it's also possible that some of my older XP-era programs were problemmatic because they manually created the user folders without checking things properly. So when the folder is in the User area maybe the junction won't be made.

I moved everything out of the User folders, deleted the User folders, then made the junction to the 'location'.

Improper resolution of Documents folder?