I am trying to run script (script1.py
) from windows task scheduler
. The script is supposed to control Chrome webdriver
and I believe it could be the root of the problem.
Result is 0x1.
Before creating the task I tested the execution of script1.py
directly from cmd
and it works.
So I've created script which writes into the file in the same location as script1.py
, than created task - 0x0
, record is added to the file.
works:
<Exec>
<Command>C:\Windows\System32\cmd.exe</Command>
<Arguments>/c C:\Users\MyUser\Anaconda3\python.exe d:\folder\write_dummy_file.py</Arguments>
</Exec>
Doesn't work:
<Exec>
<Command>C:\Windows\System32\cmd.exe</Command>
<Arguments>/c C:\Users\MyUser\Anaconda3\python.exe d:\folder\script1.py</Arguments>
</Exec>
The task to run write_dummy_file.py
was created from xml
file of the task to run script1.py
.
Those are modules used in the problem script1
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from datetime import datetime
import time
import win32com.client as comclt
import pickledb
In the logs I see "Action started", "Action completed", "Task completed". In the Task Manager I can see multiple instances of the Chromedriver, but expected job is not done - browser was never opened.