

删还删不掉,已经把Windows defender禁用了,但还是c盘爆满,该怎么办?
关注让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言问题分析:
案例:
# 清理临时文件和缓存文件
import os
import shutil
temp_folder = os.path.join(os.environ['TEMP'])
for file in os.listdir(temp_folder):
file_path = os.path.join(temp_folder, file)
try:
if os.path.isfile(file_path):
os.remove(file_path)
except Exception as e:
print("Error: %s - %s." % (e.filename, e.strerror))
# 清理浏览器缓存文件
chrome_cache = os.path.join(os.environ['LOCALAPPDATA'], 'Google\\Chrome\\User Data\\Default\\Cache')
shutil.rmtree(chrome_cache)
以上是一些简单的清理方法,如果仍然无法解决问题,建议进一步排查可能引起磁盘爆满的原因,并及时清理。