It appears to be ‘\’ at the Task Sceduler GUI. and I used the command and I want the script to open files in the same path without using absolute path.
I scheduled the task using the command:
schtasks /Create /SC HOURLY /TN PythonTask /TR "PATH_TO_PYTHON_EXE PATH_TO_PYTHON_SCRIPT"
and the script doesn’t open a database on the same folder to which Glen wrote the answer for it at Schedule Python Script – Windows 7
I think it is better to wrap calling Python script into batch
.batfile. In that file you can change directory, setPYTHONPATHetcSuch batch is then executed via:
In
my_scheduled_task.batyou can call your Python script in any directory you want.Such batch can be like: