Li Quid wrote:
>
> I'm trying to schedule a task using windows scheduled tasks for a
> python COM script.  The script runs from a normal command line
> (cscript.exe PhatPod.pys).  When the scheduled tasks manager runs the
> task, however, I get the following error:
>  
> Microsoft (R) Windows Script Host Version 5.6
> Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
>
> pythoncom error: PythonCOM Server - The 'win32com.server.policy'
> module could not be loaded.
>
> exceptions.ImportError: No module named win32com.server.policy
> pythoncom error: CPyFactory::CreateInstance failed to create instance.
> (80004005)
> CScript Error: Can't find script engine "Python" for script
> "C:\Alden\src\Apps\PhatPod\PhatPod.pys".
>
>  
> Does anybody know what causes this?  Thanks.

How did you create the scheduled task?  By default, "at" tasks run as
the special user called LOCAL_SYSTEM, which doesn't have access to your
registry nor any of your network shared drives.  If you create the task
with the Control Panel Scheduled Task Manager, you should be able to
choose the username for the task.

Why would you use the Windows script host to run this, instead of just
invoking pythonw.exe?  I've had great success running "at" tasks by
invoking Python directly.

-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to