【发布时间】:2021-03-27 15:38:28
【问题描述】:
对于法医分析的论文工作,我应该尝试自动删除创建并放置在“system32”文件夹中的文件。
这是我运行的代码:
os.system("C://Windows//System32//update.exe")
os.chmod("C://Windows//System32//update.exe", stat.S_IRWXU)
os.remove("C://Windows//System32//update.exe")
错误如下:
Traceback (most recent call last): File "C:\Users\xxxx\PycharmProjects\Tesi\main.py", line 5, in <module> os.chmod("C://Windows//System32//update.exe", stat.S_IRWXU) PermissionError: [WinError 5] Accesso negato: 'C://Windows//System32//update.exe'
如何以正确的权限运行它?
【问题讨论】: