How to update windows registry to change Edge file download directory at runtime

Zhu, Ligong 140 Reputation points
2024-06-26T12:54:48.7733333+00:00

Hi,

I need to use Windows reg tool (like reg add or reg delete) to update file download directory for Edge browser at runtime. Originally I used this location in windows registry:

HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Edge\DownloadDirectory

It worked for a while then stopped working for unknown reason, The downloaded file now is saved into default location at

%USERPROFILE%\Downloads

I searched internet again and found this location suggested by someone:

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

{374DE290-123F-4565-9164-39C4925E467B}

its default value is "%USERPROFILE%\Downloads".

If I update this value to a new location it actually works and new files downloaded from Edge will be saved there.

My question is which location in registry is correct. If the first one is correct, what is the right way to update it?

For the second location, even it works well, I have problem to restore the original value. I tried to use "reg add" to put "%USERPROFILE%\Downloads" back but the actual value added back is "123456\Downloads" where "123456" is my pin. I need to have "%USERPROFILE%\Downloads", not ""123456\Downloads".

Your help will be appreciated.

Ligong

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,217 questions
{count} votes

Accepted answer
  1. Yu Zhou-MSFT 12,856 Reputation points Microsoft Vendor
    2024-06-27T03:25:50.2666667+00:00

    Hi @Zhu, Ligong

    The right registry is the first one. Please refer to this policy: DownloadDirectory. It configures the directory to use when downloading files in Edge.

    If you set an invalid path, Microsoft Edge will default to the user's default download directory.

    For the issue that the downloaded file now is saved into default location, please check if the path you set is valid. See https://go.microsoft.com/fwlink/?linkid=2095041 for a list of variables that can be used.

    For the right way to update it using Windows reg tool, do you use Command Prompt to edit the registry? If so, you can refer to reg add to update the registry. You can also refer to my sample command line which change the download path to E:\download:

    reg add HKLM\SOFTWARE\Policies\Microsoft\Edge /t REG_SZ /v DownloadDirectory /d E:\download /f
    

    After the operation completed successfully, you can run gpupdate /force to make the registry take effect immediately.

    After you applied the registry successfully, you can open edge://policy/ and you'll find a result like this:

    User's image


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,

    Yu Zhou


0 additional answers

Sort by: Most helpful