Problems running python script by windows task scheduler that does pscp

后端 未结 6 1896
轮回少年
轮回少年 2020-12-08 23:16

Not sure if anyone has run into this, but I\'ll take suggestions for troubleshooting and/or alternative methods.

I have a Windows 2008 server on which I am running s

6条回答
  •  不思量自难忘°
    2020-12-08 23:50

    Last edit - start

    After experiments... If you put there full path to python program it works without highest privileges (as admin). Meaning task settings like this:

    program: "C:\Program Files\Python37\python.exe"
    arguments: "D:\folder\folder\python script.py"
    

    I have no idea why, but it works even if script uses subprocess and multiple threads.

    Last edit - end

    What I did is I changed task settings: checked Run with highest privileges. And task started to work perfectly while running python [script path]. But keep in mind, that title contains "Administrator: " at the begining... always...

    P.S. Thanks guys for pointing out that subprocess is a problem. It made me think of task settings. I had similar problem when one script is running from Windows Task Scheduler, and another one doesn't. Running cmd with python [script path] didn't work for me on Windows 8.1 Embedded x64. Not sure why. Probably because of necessity to have spaces in path and issue with quotes. Hope my answer helps someone. ;)

提交回复
热议问题