I made a script in Python 3.9.2 that uses pathlib (pathlib.Path.cwd())
to get current script's folder
(I then made an .exe file using PyInstaller)
If i start the script/exe manually no worries, but if I use windows scheduler or i start the script /.exe without beeing in the current folder, pathlib.Path.cwd()
(correctly) gets the current folder where I am, not the script's folder
e.g. in windows terminal
cd [...]\folderWithMyScript
py myScript.py
works good but if I'm in my home directory C:\Users\myName
and I start the script from there
py [pathToTheScript]
It wont' work (since he can't find some other folder which are below the script folder, the whole script uses a lot .joinpath('something')
Thank you in advance!