Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from random import randint
- from shutil import copyfile
- # create array item for each jpg in the logon folder
- jpgs = []
- for root, dirs, files in os.walk(r"C:\Logons"):
- for file in files:
- if file.endswith('.jpg'):
- jpgs.append(os.path.abspath(os.path.join(root, file)))
- # select random array item to be copied to system32\oobe..\backgrounds
- copyfile(jpgs[randint(0, jpgs.__len__() - 1)],
- r"C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement