Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Windows special folders location programmatically

Tags:

c#

windows

How do I change the windows special folders location? (On Win7, Preferably using C#). Basically trying to do what the windows interface allows us to do, but programmatically. (See image) On top of changing the location it should also move any existing contents.

Searched around a bit, Apparently SHSetKnownFolderPath does not work with 32 bit apps (see the comments at the end)

enter image description here

like image 692
ShaQ.Blogs Avatar asked Feb 03 '26 08:02

ShaQ.Blogs


1 Answers

You're looking to change registry entries. They should be at the following spots:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
like image 169
Tim Avatar answered Feb 04 '26 21:02

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!