python - Visual Basic Script as Windows Scheduled Task -
i trying create .bat script creating scheduled task both windows xp , 7. script run python script hidden command line window. here code .vbs script:
dim fso dim curdir dim winscripthost set fso = createobject("scripting.filesystemobject") curdir = fso.getabsolutepathname(".") set fso = nothing wscript.echo curdir set winscripthost = createobject("wscript.shell") winscripthost.run ".\python27\python.exe .\modules\monitor.py" set winscripthost = nothing
here .bat script invokes .vbs script:
schtasks /create /sc onlogon /tn monitor /tr "%~dp0schedule.vbs" @echo off pause
this script create scheduled task, when try run it, nothing shows up. can verify .vbs script works if manually run it. here folder heiarchy of program:
\project schedule.vbs create_schedule.bat \modules monitor.py
Comments
Post a Comment