sfxcl.exe 上的 Python subprocess.call 不适用于 Windows 2003 任务计划程序 [英] Python subprocess.call on sfxcl.exe not working from Windows 2003 Task Scheduler

查看:59
本文介绍了sfxcl.exe 上的 Python subprocess.call 不适用于 Windows 2003 任务计划程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用 Python 编写了一个脚本来调用 SecureFX 的命令行工具 (sfxcl.exe)

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])

然后使用py2exe将其转换为.exe.

and then converted it into .exe using py2exe.

我可以在我的 WinXP 机器上本地安排它,一切正常.当我在 Win2003 环境下手动运行它时,它也可以工作.但是,当我在 Win2003 中使用 Windows 任务计划程序安排它时,它通过脚本运行并且实际上并没有调用 sfxcl.exe(没有任何日志).我很困惑为什么这是...

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...

Win2003 服务器没有安装 Python,而我的 WinXP 有(我开发它的地方).

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

我使用的是 Python 2.7.1.

I'm using Python 2.7.1.

否则,如果对此没有答案 - 我应该考虑运行一次脚本并将其设置为使用间隔重新运行,什么不?其他选择?它需要每 15-20 分钟运行一次.

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.

现在,我忘了提到它正在调度程序中使用另一个帐户,并且该帐户没有设置 SecureFX 会话/配置,因此只有那部分没有运行.

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.

这不是 Python 问题.

It isn't a Python problem.

这篇关于sfxcl.exe 上的 Python subprocess.call 不适用于 Windows 2003 任务计划程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆