尝试使用 python 脚本自动删除文件,我得到:
Traceback (most recent call last):
Python script "5", line 8, in <module>
shutil.rmtree(os.path.join(root, d))
File "shutil.pyc", line 221, in rmtree
File "shutil.pyc", line 219, in rmtree
WindowsError: [Error 5] Access is denied: 'C:\\zDump\\TVzip\\Elem.avi'
使用这个
import os
import shutil
for root, dirs, files in os.walk(eg.globals.tvzip):
for f in files:
os.remove(os.path.join(root, f))
for d in dirs:
shutil.rmtree(os.path.join(root, d))
for root, dirs, files in os.walk(eg.globals.tvproc):
for f in files:
os.remove(os.path.join(root, f))
for d in dirs:
shutil.rmtree(os.path.join(root, d))
一切都以管理员身份运行,有什么帮助吗?