开发者

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

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 environ开发者_运维技巧ment, 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜