[python-win32] Take Screenshot when you log in remotely [Win 7 Pro]
Tim Roberts
timr at probo.com
Thu Jul 5 19:24:51 CEST 2012
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, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list