On widows, running the script in the directory of the recording results in a filesystem lock on the directory, so that it cannot be deleted.