搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

How can I retrieve the current profile path & name from a command line?

  • 6 回覆
  • 1 有這個問題
  • 527 次檢視
  • 最近回覆由 FredMcD

more options

I'm trying to create a DOS batch file to clear the current profile's cache (web site data only, not cookies). I have it working fine using a hard-coded path of the existing profile (I only have one profile), but I'd like it to remain viable in case a newer profile is created for whatever reason. Is there a way to retrieve the path into a variable?

Thank you!

I'm trying to create a DOS batch file to clear the current profile's cache (web site data only, not cookies). I have it working fine using a hard-coded path of the existing profile (I only have one profile), but I'd like it to remain viable in case a newer profile is created for whatever reason. Is there a way to retrieve the path into a variable? Thank you!

被選擇的解決方法

I don't think there is such an option: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options

Sorry, this link no longer in use.


We do not recommend using other programs to clean Firefox because they could corrupt the files. Also, the browser can clean itself.


Type about:preferences#privacy<enter> in the address box. The button next to History, select Use Custom Settings.

Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

從原來的回覆中察看解決方案 👍 1

所有回覆 (6)

more options

type about:profiles in the firefox address bar and hit enter

more options

選擇的解決方法

I don't think there is such an option: https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options

Sorry, this link no longer in use.


We do not recommend using other programs to clean Firefox because they could corrupt the files. Also, the browser can clean itself.


Type about:preferences#privacy<enter> in the address box. The button next to History, select Use Custom Settings.

Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

由 FredMcD 於 修改

more options

Once upon a time I wrote a VBScript to parse the installs.ini file for default profile paths and build a session history file backup script. I'm not sure it works in 2022, but if you want to take a look for inspiration:

https://gist.github.com/jscher2000/9bb73efe9046bcdbb1c8a31f78386d21

more options

jscher2000 said

Once upon a time I wrote a VBScript...

Thank you! I'll look into this for sure.


FredMcD said

We do not recommend using other programs to clean Firefox because they could corrupt the files. Also, the browser can clean itself. Type about:preferences#privacy<enter> in the address box. The button next to History, select Use Custom Settings. Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

Thank you for this - I wasn't pursuing a solution within FF because I only knew of the option to clear BOTH cache and cookies when FF exits. This looks like a great way to do what I want. (I will say, it seems to me that the option in Settings should allow selection of cookies separately from cache, just like it does in the nearby "Clear Data" function.)

I appreciate the help!

由 mike.fairleigh 於 修改

more options

FredMcD said

Type about:preferences#privacy<enter> in the address box. The button next to History, select Use Custom Settings. Turn off Always Use Private Browsing Mode Turn on Remember My Browsing And Download History At the bottom of the page, turn on Clear History When Firefox Closes. At the far right, press the Settings button. Turn on ONLY Cache and Form And Search History leaving the others off.

This is the way. And now I understand what I was missing all along. Thank you!

more options

Glad to help. Safe Surfing.