X
Πατήστε εδώ για μετάβαση στην έκδοση της ιστοσελίδας για κινητές συσκευές.

Φόρουμ υποστήριξης

Setting browser.cache.disk.parent_directory to dynamic location (different for each user)

Δημοσιεύτηκε

https://support.mozilla.org/en-US/questions/new/desktop/customize/form?search=change+location+of+cache&step=aaq-question


Setting browser.cache.disk.parent_directory to dynamic location (different for each user)

I’m attempting to set browser.cache.disk.parent_directory in about:config to a custom dynamic path string using the Windows %username% variable in order to make it so that each Windows account has its Firefox cache in a different location that is somewhere other than each user’s AppData. What I tried to use was this:

T:\Users\%username%\Firefox\Cache

However, that created a folder path with %username% (literally, not substituted by its value as a Windows variable) as part of it. Is there some way for me to accomplish this?

https://support.mozilla.org/en-US/questions/new/desktop/customize/form?search=change+location+of+cache&step=aaq-question Setting browser.cache.disk.parent_directory to dynamic location (different for each user) I’m attempting to set browser.cache.disk.parent_directory in about:config to a custom dynamic path string using the Windows %username% variable in order to make it so that each Windows account has its Firefox cache in a different location that is somewhere other than each user’s AppData. What I tried to use was this: T:\Users\%username%\Firefox\Cache However, that created a folder path with %username% (literally, not substituted by its value as a Windows variable) as part of it. Is there some way for me to accomplish this?
Παράθεση

Επιπρόσθετες λεπτομέρειες συστήματος

Εγκατεστημένα αρθρώματα

None

Εφαρμογή

  • Πλατφόρμα χρήστη: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0 Cyberfox/52.9.1

Περισσότερες πληροφορίες

FredMcD
  • Top 10 Contributor
4272 λύσεις 59922 απαντήσεις
Δημοσιεύτηκε

Each user on a computer already has a separate profile. The profile folders store all data for that user. There is no need for what you want.

Is there a problem or concern?

Each user on a computer already has a separate profile. The profile folders store all data for that user. There is no need for what you want. Is there a problem or concern?
Σάς φάνηκε χρήσιμο; 0
Παράθεση
Δημοσιεύτηκε

Ιδιοκτήτης ερώτησης

I did write, “in order to make it so that each Windows account has its Firefox cache in a different location that is somewhere other than each user’s AppData”. In a nutshell, my preference is to have each user’s personal and customization data (including browser profiles) on a separate data partition, and all temporary files and caches on another separate partition. When I set Firefox up, I used “firefox.exe -P” to delete the default profile for each Windows account, then created new profiles on my data partition for each account. I now wish to make it so each account’s cache is on my temporary files partition, with separate folders for each account. If necessary, I could accomplish it by using folder junctions, but I’d prefer to have a one-time-configuration solution.

I did write, “in order to make it so that each Windows account has its Firefox cache in a different location that is somewhere other than each user’s AppData”. In a nutshell, my preference is to have each user’s personal and customization data (including browser profiles) on a separate data partition, and all temporary files and caches on another separate partition. When I set Firefox up, I used “firefox.exe -P” to delete the default profile for each Windows account, then created new profiles on my data partition for each account. I now wish to make it so each account’s cache is on my temporary files partition, with separate folders for each account. If necessary, I could accomplish it by using folder junctions, but I’d prefer to have a one-time-configuration solution.
Σάς φάνηκε χρήσιμο;
Παράθεση
FredMcD
  • Top 10 Contributor
4272 λύσεις 59922 απαντήσεις
Δημοσιεύτηκε

I called for more help.

I called for more help.
Σάς φάνηκε χρήσιμο;
Παράθεση
cor-el
  • Top 10 Contributor
  • Moderator
17585 λύσεις 159079 απαντήσεις
Δημοσιεύτηκε

You can possibly do this via an autoconfig.cfg file via a getenv() function call.

See:

You can possibly do this via an autoconfig.cfg file via a getenv() function call. See: *https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig
Σάς φάνηκε χρήσιμο;
Παράθεση
Δημοσιεύτηκε

Ιδιοκτήτης ερώτησης

This didn’t work, at least not as attempted. The page you kindly linked to doesn’t offer any examples for usage of environment variables, so I guessed at it. The code I used in “firefox.cfg” was:

// IMPORTANT: Start your code on the 2nd line getenv(username) lockPref("browser.cache.disk.parent_directory", "T:\Users\%username%\AppData\Local\Mozilla\Firefox\Profiles\Default\Cache")

Is there something I need to change?

This didn’t work, at least not as attempted. The page you kindly linked to doesn’t offer any examples for usage of environment variables, so I guessed at it. The code I used in “firefox.cfg” was: // IMPORTANT: Start your code on the 2nd line getenv(username) lockPref("browser.cache.disk.parent_directory", "T:\Users\%username%\AppData\Local\Mozilla\Firefox\Profiles\Default\Cache") Is there something I need to change?
Σάς φάνηκε χρήσιμο;
Παράθεση
Δημοσιεύτηκε

Ιδιοκτήτης ερώτησης

Actually, I just discovered that the code in my previous message created a folder named “T:\Users%username%AppDataLocalMozillaFirefoxProfilesDefaultCache”. I was able to fix the lack of folder hierarchy by doubling the backslashes in “firefox.cfg” as follows:

"T:\\Users\\%username%\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\Default\\Cache"

But it still created a folder literally named “%username%”

Actually, I just discovered that the code in my previous message created a folder named “T:\Users%username%AppDataLocalMozillaFirefoxProfilesDefaultCache”. I was able to fix the lack of folder hierarchy by doubling the backslashes in “firefox.cfg” as follows: "T:\\Users\\%username%\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\Default\\Cache" But it still created a folder literally named “%username%”
Σάς φάνηκε χρήσιμο;
Παράθεση
cor-el
  • Top 10 Contributor
  • Moderator
17585 λύσεις 159079 απαντήσεις
Δημοσιεύτηκε

You misunderstood, you need to assign getenv("USERNAME") (note the quotes) or use this function call directly/ Try this code in autoconfig.cfg instead:

//
lockPref("browser.cache.disk.parent_directory", "T:\\Users\\"+ getenv("USERNAME")+"\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\Default\\Cache");
You misunderstood, you need to assign getenv("USERNAME") (note the quotes) or use this function call directly/ Try this code in autoconfig.cfg instead: <pre><nowiki>// lockPref("browser.cache.disk.parent_directory", "T:\\Users\\"+ getenv("USERNAME")+"\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\Default\\Cache");</nowiki></pre>
Σάς φάνηκε χρήσιμο;
Παράθεση
Δημοσιεύτηκε

Ιδιοκτήτης ερώτησης

That worked! Thank you!

I doubt if I’d ever need to worry about multiple Firefox profiles for one Windows account, but anybody know if there’s an environment variable that stores that name of the profile in use? If so, I wouldn’t mind fine-tuning my CFG file even more along the lines of this:

lockPref("browser.cache.disk.parent_directory", "T:\\Users\\"+ getenv("USERNAME")+"\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\"+getenv("[PROFILENAME]")+"\\Cache");

…Just to keep multiple profile caches from intermingling.

That worked! Thank you! I doubt if I’d ever need to worry about multiple Firefox profiles for one Windows account, but anybody know if there’s an environment variable that stores that name of the profile in use? If so, I wouldn’t mind fine-tuning my CFG file even more along the lines of this: lockPref("browser.cache.disk.parent_directory", "T:\\Users\\"+ getenv("USERNAME")+"\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\"+getenv("[PROFILENAME]")+"\\Cache"); …Just to keep multiple profile caches from intermingling.
Σάς φάνηκε χρήσιμο;
Παράθεση
Κάντε μια ερώτηση

Πρέπει να συνδεθείτε στο λογαριασμό σας για να απαντήσετε στις δημοσιεύσεις. Παρακαλούμε ξεκινήστε μια νέα ερώτηση, αν δεν έχετε ήδη λογαριασμό.