PROBLEM: So basically I'm running a python script that only works if I'm running it on my task scheduler set to "Run only when user is logged on" and fails when run on "Run whether user is logged on or not".
FINDINGS:
- The error code I get in the Last Run Result when it fails is 0xC0000005.
- I know the path is right cause I copied the file within the code while debugging and it copied the file to another location (proving it's a valid path)
- I don't think it's actually throwing an error. I surrounded my entire python code with a try catch, and if it fails within the try the catch has code that'll write the error to a textfile and send a notification to my phone - but it never does that. It just fails at that line.
- The code where it fails is specifically the .load_state line:
plugin_path = path.join(getcwd(), 'Plugins', 'Vital')
states_path = path.join(plugin_path, 'States')
plugin_dlls = glob.glob(f"{plugin_path}/*.dll")
engine = daw.RenderEngine(44100, 512)
engine.set_bpm(bpm)
plugin = engine.make_plugin_processor("my_plugin", plugin_dlls[0])
state_files = listdir(states_path)
chosen_state_file = state_files[random.randint(0, len(state_files)-1)]
plugin.load_state(str(path.join(states_path, chosen_state_file)))
GENERAL INFORMATION:
- I'm using https://github.com/DBraun/DawDreamer.
- I'm running a python script (3.9) through the task scheduler on a Windows 11 PC.
HYPOTHESIS:
- There's something wrong with the actual Dawdreamer package. If so, how could I verify this?
