Programmatically Changing Chrome's download path on Windows 8

3,302 views
Skip to first unread message

Jack

unread,
Feb 22, 2016, 2:27:10 PM2/22/16
to Chromium-discuss
Hello everyone, I am not sure exactly where to post this but here goes. I want to be able to change Chrome's preferences programmatically, particularly the path that files download to. I can access Chrome's 'Preferences' file (located in C:\Users\User Name\AppData\Local\Google\Chrome\User Data\Default) and change the download directory. If Chrome is not running, then these changes will take hold and everything works fine. If the browser is running, however, any changes I make to the Preferences file are overwritten once I do anything in the browser. Is there any way to change this? How do I change the preferences and have it take hold immediately and not be overwritten? I want to be able to do this without shutting down the browser.

PhistucK

unread,
Feb 22, 2016, 2:54:23 PM2/22/16
to nisp...@gmail.com, Chromium-discuss
I am quite surprised that the changes stick, actually.

You cannot change it while Chrome is running. You should not change it while Chrome is not running as well.

Does it not adhere to the Downloads path defined within your system? I do not remember.
Anyway, perhaps master_preferences is the right way to do it.
(It still will not let you change existing profiles or currently-open-profiles)


PhistucK

On Mon, Feb 22, 2016 at 9:27 PM, Jack <nisp...@gmail.com> wrote:
Hello everyone, I am not sure exactly where to post this but here goes. I want to be able to change Chrome's preferences programmatically, particularly the path that files download to. I can access Chrome's 'Preferences' file (located in C:\Users\User Name\AppData\Local\Google\Chrome\User Data\Default) and change the download directory. If Chrome is not running, then these changes will take hold and everything works fine. If the browser is running, however, any changes I make to the Preferences file are overwritten once I do anything in the browser. Is there any way to change this? How do I change the preferences and have it take hold immediately and not be overwritten? I want to be able to do this without shutting down the browser.

--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Jack Nispe

unread,
Feb 22, 2016, 3:12:55 PM2/22/16
to PhistucK, Chromium-discuss
Thanks for your reply. Yes indeed the changes do stick if Chrome is not running. All I have to do it edit any references I find to the download path in 'Preferences'. Why is it that Chrome will reset it when it is running, and why is it a bad thing to change it? I am rather new to this and was just experimenting. What I have been trying to do expedite certain activities in my GUI. So for example, if I want to download a bunch of files to a particular folder, I simply right-click on that folder and press "Set Download Path" and now Chrome will download to that folder. The custom right-click functionality is easy to add with registry edits. Of course I can just set the download path in the browser by going to advanced settings, and maybe this is easier (again, I am experimenting :) ). But it seems odd to me that if I can change Chrome's download path in the browser by going into the settings menu, that I can't just do programmatically by editing the appropriate files on my computer.

PhistucK

unread,
Feb 22, 2016, 4:01:14 PM2/22/16
to Jack Nispe, Chromium-discuss
The problem is that the Preferences file is not a stable file, its structure can change at any time, plus malware tries to change it so Chrome tries to protect against such manual changes. Perhaps it only cares about specific preferences in the file and protects only against them, I do not know.

On Windows, you can set a directory as a "library", if I recall correctly and it will then show up on the side bar of the "Save as..." dialog (if you set Chrome to show you the dialog) and you can just click on that added library. Perhaps this is more stable.


PhistucK

Ben Hooper

unread,
Jul 31, 2020, 4:41:26 AM7/31/20
to Chromium-discuss
I want to do the same thing. Did you ever find a solution?
Reply all
Reply to author
Forward
0 new messages