Problem with take a screenshot activity

Hi everybody,

I’m having issues with “take screenshot activity”. Sometimes (rearely, like 1 every 15-20 times) it gives me the following error:

message: Invoke TakeScreenshot workflow: System.ComponentModel.Win32Exception (0x80004005): The handle is invalid at System.Drawing.Graphics.CopyFromScreen(Int32 sourceX, Int32 sourceY, Int32 destinationX, Int32 destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at System.Drawing.Graphics.CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size blockRegionSize, CopyPixelOperation copyPixelOperation) at UiPath.Vision.UiImage.FromScreenRegion(Rectangle region) at UiPath.Core.Image…ctor(Region screenRegion)

level: Error

For the first year and half I never got this problem, since last week it started. Has anyone got the same problem?

I also thought that could be related to a new process o something like that which runs recently. But I don’t know how to investigate and find it.



This error comes when the vdi is left open without logging out…or is left login and the next bot has started

Make sure you logout the vdi/vm before you start the next process


hi Anil,

thanks for answering.
About the logout, if it’s not done by a previous process (robot), shouldn’t be the vdi “busy” and then the new process shouldn’t be able to start?

How do you log out the process ?


Generally that depends on the robot settings…In robot settings we have option to lgoin to console…we can enable it.

it shoudl ideally logout but in newer versiosn sometimes we are seeing this issue…

the vdi is left open but the bot closes…if login to console is set to true then we can


Log into your server as the robot account, then click Sign Out. You always have to sign out, you can’t just close the RDP window.