I have looked at tons of posts and things for 1-2 hours now and i can't find a solution. Im trying to use shutil.copytree() however it makes the folder then throws the error "FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\Users\user\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\background'"? And im not entirely sure why here is my program
import shutil
import ctypes
import random
import getpass
import os
username = str(getpass.getuser())
target_images_path = r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\background".format(username)
if not os.path.exists(target_images_path):
os.makedirs(target_images_path)
target_path = r"C:\Users\{}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup".format(username)
shutil.copy("main.exe", target_path)
shutil.copytree('background', target_images_path)