我正在使用以下代码将文件夹PStool
的内容复制到文件夹c:/WINDOWS/System32
。我以管理员的身份运行这个程序
import shutil
import os
programSourcePath = "C:\Users\Admin\Desktop\Utilities_Installers_new\Programs"
pstoolfiles = os.listdir(programSourcePath + '/PSTools')
for name in pstoolfiles:
srcname = os.path.join(programSourcePath + '/PSTools', name)
shutil.copyfile(srcname, r'c:/WINDOWS/System32')
获取
PermissionError: [error 13] permission denied : 'c:/WINDOWS/System32'
copyfile()目标应该是完整的文件名。根据Python文件:
试试这个:
相关问题 更多 >
编程相关推荐