Batch file path definition

Hello,

I am able to start up a batch file like this:

from subprocess import Popen

file = “C:\Users\RP2-9\OneTrainer\start-ui.bat”

Popen( [ file ] )

It works nicely, but only if the .toe file is in the same directory as the .bat - if it isn’t, the script can’t find the scripts it’s calling, as it is referring to the directory of the .toe file.

Is there any way to get it to work with the .toe file in a different directory?

what is the error you are getting?

Thank you for your reply! I get this in the cmd window:

activating venv C:\Users\jeremykeenan\OneTrainer\venv

C:\Users\jeremykeenan\AppData\Local\Programs\Python\Python310\python.exe: can’t open file ‘C:\Users\jeremykeenan\Desktop\scripts\train_ui.py’: [Errno 2] No such file or directory

Press any key to continue . . .