Python subprocess.call on sfxcl.exe not working from Windows 2003 Task Scheduler

佐手、 提交于 2019-12-13 19:25:19

问题


I have written a script in Python to call SecureFX's commandline tool (sfxcl.exe)

result = subprocess.call([securefx, '/NoPrompt', '/Q', '/RetryCount', retries,
                 '/RetryDelay', '1', '/Log', sfxLogFile, '/List', '/S', session])

and then converted it into .exe using py2exe.

I can schedule it locally on my WinXP machine and everything works OK. When I run it manually on the Win2003 environment, it also works. BUT when I schedule it using Windows Task Scheduler in Win2003, it runs through the script and doesn't actually call sfxcl.exe (no logs whatsoever). I'm pretty stumped as to why this is...

The Win2003 server does not have Python installed, while my WinXP does (where I developed it).

I'm using Python 2.7.1.

EDIT: Or otherwise, if there is no answer to this - should I consider running the script once and set it to re-run using intervals and what not? Other options? It needs to run every 15-20minutes.


回答1:


So I've found the problem and it really is quite dumb. If it works manually, you should expect it to work in the Task Scheduler.

Now, I forgot to mention that it was using another account in the Scheduler, and that account didn't have SecureFX sessions/config set up and thus only that part didn't run.

It isn't a Python problem.



来源:https://stackoverflow.com/questions/6922129/python-subprocess-call-on-sfxcl-exe-not-working-from-windows-2003-task-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!