in cortado/rtas/user_dir_escalation.py [0:0]
def main() -> None:
# make sure path is absolute for psexec
if not _common.elevate_to_system():
raise _common.ExecutionError("Can't elevate to system")
log.info("Run a user-writeable file as system")
source_path = _common.get_resource_path("bin/myapp.exe")
target_directory = "c:\\users\\fake_user_rta-%d" % os.getpid()
if not Path(target_directory).is_dir():
Path(target_directory).mkdir(parents=True)
target_path = Path(target_directory) / "user_file.exe"
_common.copy_file(source_path, target_path)
_ = _common.execute_command(str(target_path), shell=True)
_common.remove_directory(target_directory)