Scripting malware with Python

The script:

https://github.com/twhite96/hacker-scripts-python/blob/main/network-chuck/ransomware/givemeyourmoney.py

This script is pretty simple; we're just iterating over plain text files and encrypting them.

But what about encrypting a whole directory of things other than flat text files?

What would need to happen in this script to make it efficient so that if someone clicks on a macro with a script like this in it it encrypts the directory/disk as quickly as possible without allowing the user to stop the script?

How could you have the script wait until the OS is sleeping to encrypt all these files/directories/disks?

Privilege Escalation