為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

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

了解更多

How can I automate the clearing of cached web content with powershell script?

  • 5 回覆
  • 1 有這個問題
  • 11 次檢視
  • 最近回覆由 Shadow110

more options

I have a powershell script for automating the clearing of browser history and cache. The script works for clearing firefox's history but even after the script deletes the cache2 folder it seems to recreate itself once firefox is reopened. Is there another folder or file that would need to be deleted and recreated as well in order for this to work?

I have a powershell script for automating the clearing of browser history and cache. The script works for clearing firefox's history but even after the script deletes the cache2 folder it seems to recreate itself once firefox is reopened. Is there another folder or file that would need to be deleted and recreated as well in order for this to work?

所有回覆 (5)

more options

Maybe use Private Browsing mode if you do not want to keep cache and history.

Firefox will always recreate files and folders when Firefox notices that they are missing. That is expected behavior. Why would you expect differently?

more options

Private browsing does not help in this instance. Again I need to automate this because I need to be able to run this against a mass number of computers. Yes it should recreate files but not when you want them gone. In older versions of firefox you could simply delete the cached folders and the cache would be clear until it rebuilt over time from browsing webpages. Howevever, it appears that has changed as those files reappear once firefox is reopened. Therefore, can you tell me what process the gui takes when clearing the cached web content? As in what are the files and folders that it clears or commands that it runs.

more options
more options

I am not as familiar with javascript and therefore am not exactly sure how I could apply this. Do you know of a powershell or vbscript that could accomplish this? Alternatively maybe instead of a script that tries to clear the cache could a script be written to say change a registry key or preference file that would clear the users cache on browser exit? I know you can set this up within the browser but not sure it there is a way to automate it.

more options

Hi, you could try a extension that would be 1 click to do. https://addons.mozilla.org/en-US/firefox/search/?platform=windows&q=Clear+Cahe This maybe useful to you to keep things all in one place : https://addons.mozilla.org/en-US/firefox/addon/tampermonkey/

You can then possibly add Cor-el's info or scripts from that page to this program.