Programmatically Change Download location for Chrome

sxschech

Registered User.
Local time
Yesterday, 23:31
Joined
Mar 2, 2010
Messages
802
Was wondering about vba code to change the default download location for Chrome so that I can have some files be saved somewhere other than the default. I found code that can show where the downloads are being saved to, didn't seem to locate code for how to change it. I manually changed it and forgot over the weekend, so when started downloading today, didn't see my files at first until I remembered I changed the location.
 
Just a guess but maybe it's set in the registry. If you can determine the default location by code, it's just an extra step to move the downloaded file to its final destination, and you won't have to mess with the registry or Chrome.
 
good idea and agree would rather not mess with Registry (may not even have permission to do so at work). maybe I'm missing something though. follow up question...even though I can know ahead of time where the files are default saved to, what will tell the code which files to move to the final destination? The files are not being downloaded via Access, I am going to a third party website and clicking on links to download the files from within the browser. If I have to look and review to see which of the files should be moved after they've been downloaded, I am already defeating the purpose.
 
good idea and agree would rather not mess with Registry (may not even have permission to do so at work). maybe I'm missing something though. follow up question...even though I can know ahead of time where the files are default saved to, what will tell the code which files to move to the final destination? The files are not being downloaded via Access, I am going to a third party website and clicking on links to download the files from within the browser. If I have to look and review to see which of the files should be moved after they've been downloaded, I am already defeating the purpose.
Oh, I thought you were downloading files using VBA already. If not, would it be too much trouble for you to clear up the downloads folder first, so you can simply move "all" the files in there after you're done clicking links? If not, you might consider reviewing this article, just in case it might be useful.
 
At this point, would rather not clear the downloads as I use it as a lazy repository since we receive files from all over (web, network, email) and some will have additional work done with them and get renamed. Since I know where all the files are, I can get to them easily if someone has a question or I need to follow a particular naming convention on new files etc. Since the other was a kind of one-off is not a big concern, except to see if that was a possibility.

Thanks for the blog link, could be useful at some point for another site that maybe stores the files in a more familiar way as doesn't look practical for the files I'm currently downloading. I hovered on one of the files to see the link and the file name is not recognizable to me.
 
Chrome settings is saved in C:\Users\_username_\AppData\Local\Google\Chrome\User Data\Default
You can open Preferences file with a text editor (notepad) and change the following:

"download":{"default_directory":"D:\\Downloads"

But to be able to do this change you should close Chrome first to be able to overwrite the preferences.

even though I can know ahead of time where the files are default saved to, what will tell the code which files to move to the final destination?
You know the start time of downloading. You can use FileDateTime function in vba to check the created timestamp:
If FileDateTime("D:\Test.txt")>#2026/08/23 11:22:19# then ........

OR

You can use FSO to loop through files and check their created time:
FSO.GetFile(sFile).DateCreated
 
Last edited:
Why not just look for files created within a certain time period?
 
Chrome settings is saved in C:\Users\_username_\AppData\Local\Google\Chrome\User Data\Default
You can open Preferences file with a text editor (notepad) and change the following:
Tried your suggestion, closed the browser, edited the preference file and unfortunately, didn't seem to affect the download location.

Why not just look for files created within a certain time period?

Assuming the files were all downloaded in the same time frame, that would work, however, when there are interruptions, files get comingled with other downloads not related to that project so can't rely on that.

For now, I'll just continue to click on the three dots in the browser and change the default location as needed.

I do appreciate the advice.
 
From Google:
By default, Chrome, Firefox and Microsoft Edge download files to the Downloads folder located at %USERPROFILE%\Downloads. USERPROFILE is a variable that refers to the logged in user's profile directory on the Windows computer, e.g. the path may look like C:\Users\YourUserName\Downloads

2023-08-22 14_29_53-Settings - Downloads-Chrome.png
 
Jack, mine is set to a downloads folder on one of my NAS boxes, so they are available to any device.
 

Users who are viewing this thread

Back
Top Bottom