Default Documents folder still being use even though changed

0

"Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal" has been changed to "D:\Users[user]\OneDrive\Documents", so has the "Documents Properties" and all works well, even OneDrive is correctly syncing. However some programs (including Unreal Engine) is still using "C:\Users[user]\Documents"

Is there any way to fix this or has Epic and otehrs just hard-coded the location instead of using correct standards for Windows?

Edit: Also when starting CMD it defaults to "C:\Users[user]\Documents" instead of the correct D: version.

Dorjan

Posted 2019-04-29T08:36:12.547

Reputation: 111

Answers

0

Created a junction using "junction64.exe" v1.07 from Microsoft. https://docs.microsoft.com/en-gb/sysinternals/downloads/junction

In elevated command prompt I used the following commands:

del "C:\Users[user]\Documents"
junction64 "C:\Users[user]\Documents" "D:\Users[user]\OneDrive\Documents"

Dorjan

Posted 2019-04-29T08:36:12.547

Reputation: 111

1

You need to edit the values under:

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

In addition to the value named 'Personal', if a value named '{f42ee2d3-909f-4907-8871-4c22fc0bf756}' exists, set that to your desired 'Documents' path as well.

For the Command Prompt, you need to edit the properties of the shortcut that launch Command Prompt.

  1. In the Explorer Address bar, type: shell:programs
  2. Open the Windows System folder
  3. Right-click Command Prompt & select Properties
  4. Edit the Start in: value (or the underlying environmental variables)

Keith Miller

Posted 2019-04-29T08:36:12.547

Reputation: 1 789

Oh very interesting about the Windows System! %HOMEDRIVE%%HOMEPATH%, So it's defaulting not to my documents but to my user point which of course will still be on c – Dorjan – 2019-04-30T06:33:16.990

Oh, also this doesn't solve the other problems unfortunately. Some developers seem to use the %HOMEDRIVE%%HOMEPATH% method to find the documents folder instead of the correct API. So the redirect in the other answer seems the only way to permi solve the problem. However there's a side effect that you'll see things twice in some programs as they think it's in two places.... – Dorjan – 2019-04-30T07:32:00.513