关闭谷歌浏览器缓存

博客介绍了关闭谷歌浏览器缓存的方法,即先按F12,再按F1,然后选择disable cache,这是信息技术中关于浏览器操作的实用技巧。
关闭谷歌浏览器缓存:先按F12,再按F1,选择disable cache
以下是几种同类型用于清理谷歌浏览器缓存的脚本: ### 批处理脚本 ```batch @echo off rem 注:只能用userprofile,能用appdata echo. echo 正在清理,请等待.... rem 注:同版本谷歌浏览器缓存路径同,请及添加更新 del /f /s /q "%userprofile%\AppData\Local\Google\Chrome\User Data\Default\Cache\." >nul del /f /s /q "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\Default\Cache\." >nul cls echo. echo. echo. echo 清理完成,按任意键退出.... pause >nul ``` 该脚本会清理同路径下的谷歌浏览器缓存,运行会提示正在清理,完成后提示按任意键退出 [^1]。 ```batch @echo The program will be start in 2 sec @echo Please exit your chrome,otherwise will auto shutdown Chrome. @echo off ping 127.0.0.1 -n 2 >nul taskkill /f /im chrome.exe ping 127.0.0.1 -n 2 >nul ren "C:\Users\%username%\AppData\Local\Google\Chrome\User Data" "User Data-Up" ping 127.0.0.1 -n 2 >nul rd /s /q "C:\Users\%username%\AppData\Local\Google\Chrome\User Data-Up" @echo Done,Please restart Chrome for test ``` 此脚本会先提示用户退出 Chrome 浏览器,若未退出则自动关闭 Chrome,然后重命名并删除用户数据文件夹,最后提示重启 Chrome 进行测试 [^3]。 ### PowerShell 相关脚本 需要借助批处理文件 `cleargoogle.bat` 与 PowerShell 脚本 `google.ps1` 配合使用。 `cleargoogle.bat` 内容如下: ```batch pushd %~dp0 powershell.exe -command ^ "& {set-executionpolicy Remotesigned -Scope Process; .'.\google.ps1' }" popd pause ``` 将该 `bat` 文件与 `powershell` 脚本放在同一目录,直接运行 `bat` 文件即可。此脚本可清理 Google 浏览器缓存、密码凭证、cookies 等 [^2]。 ### Python 脚本 ```python import os import shutil def mv_dir(): delList = [] delDir = r"C:\Users\Administrator\AppData\Local\Google\Chrome\User Data" delList = os.listdir(delDir) for f in delList: filePath = os.path.join(delDir, f) if os.path.isfile(filePath): os.remove(filePath) elif os.path.isdir(filePath): shutil.rmtree(filePath, True) if __name__ == '__main__': mv_dir() ``` 该 Python 脚本会删除指定路径下的谷歌浏览器用户数据文件夹中的所有文件和文件夹 [^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值