Python Forum

Full Version: copy content of folder to existing folder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to copy content of folder to existing folder
using following code and got 'PermissionError: [error 13] permission denied : 'c:/WINDOWS/System32'
the program is run under administrator

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)
    dstname = os.path.join(r'c:/WINDOWS/System32', name)
    shutil.copyfile(srcname, dstname)
Thanks,