I have created a simple python executable file using auto-py-to-exe where certain messages are displayed which also has some images in the messages.
The one file executable script works perfect when I open it myself by going to the folder where I have saved it but when I create a task using windows task scheduler on windows 10 I get the following message:
Traceback (most recent call last): File "Daily_maintenance_V4.pyw", line 61, in File "tkinter_init_.py", line 2080, in wm_iconbitmap _tkinter.TclError: bitmap "C:\WINDOWS\system32\asn.ico" not defined
even if I create a directory instead of one file using auto-py-to-exe and point the task scheduler to the exe file I get the same error.
If I save the required images in C:\WINDOWS\system32 then the task scheduler open executable file is working fine.
Is there a way I can create this task without saving images in C:\WINDOWS\system32 as to do this I will need admin rights in some production PCs.
Any help will be appreciated!
A python newbie here!
Thanks.
I have included the following line which I found researching about this but it doesn't help with the images:
def resource_path(relative):
return os.path.join(os.environ.get("_MEIPASS2",os.path.abspath(".")),relative)
return os.path.join(base_path, relative_path)