脚本“alerts.vbs”:
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
CreateObject("WScript.Shell").Run "C:\\windows\\system32\\cmd.exe /c C:\\Anaconda2\\python.exe C:\\folder\\alerts.py",10,True
Python脚本“alerts.py”(python 2.7):
logdir='//servername/path/folder/'
logfiles = sorted([ f for f in os.listdir(logdir) if f.startswith('tms_int_calls-')])
上面目前仅在我在spyder中运行python脚本或直接运行vbscript时才有效。当我通过Windows任务计划程序运行它时,它在本段“已排序(... ”)上方的行上崩溃。任务计划程序设置为以用户SYSTEM,最高权限运行它“隐藏“未检查。
我尝试了什么:
我认为这可能与权限有关...
使用vbs运行时的日志文件或直接在spyder中运行:
20160427155829 ...start
20160427155829 ...imported modules
20160427155835 ...ran php
20160427155835 ...begin sort locate
20160427155835 ...done sort locate
20160427155835 ...begin sort locate
20160427155835 ...done sort locate
20160427155835 ...file open is : tms_int_calls-20160426161451-1098499292.csv
20160427155836 ...sent email
20160427155836 ...complete !
使用任务计划程序运行时
20160427155850 ...start
20160427155850 ...imported modules
20160427155857 ...ran php
20160427155857 ...begin sort locate