Ferdinand Sousa wrote: > > I have written a script that uses the screenshot() function from the > ImageGrab module of the Python Imaging library and I would like to run > this script as a scheduled task. > > Now for the issues. In the task scheduler, if I select 'Run whether > user is logged on or not', it does run, but the scheduler shows it as > failed to run. This happens both when logged in or if logged in and > session is locked > > So, I chose to use the 'Run only when user is logged on' option. Now, > this works well, when logged on as well as if the session is locked. > The problem is if I try to login remotely via RDP this stops working > the moment I disconnect.
Right. When you disconnect the session, there no longer is any screen to take a shot of. Screenshots are implemented by calling the graphics driver. A disconnected session does not have a graphics driver. Windows does not keep a backing store copy of a session's frame buffer anywhere. When a disconnected session is reconnected, all of the applications are sent "paint" messages to force the screen to be repainted from scratch. > Is there any option I could use to make it work under 'Run whether > user is logged on or not' Task scheduler option? > Maybe I could reduce the privilege level needed to execute python.exe? That won't help. What you ask is simply not possible. The bits you want to grab do not exist. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32