Take Screenshot error when running in background on vm


When I tested “Take Screenshot” activity locally it worked fine, but when I tried to run it in background on a vm, I got the following exception:

Take Screenshot: 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)

I tried changing hight, width, depth from orchestrator, but it didn’t solve the problem. Is this problem caused by new updates because I’ve seen some solutions saying that for this type of exception I should uninstall and install everything again.

Thank you!

1 Like


Welcome to community

Is your bot is running as a Unattended bot license?


Yes, my robot is Unattended.


which studio version? Is it community or enterprise?


Studio pro 2020.10.2 community license

Pablito can you please help?

Studio Pro 2020.10.2 Community License
Orchestrator 2020 Community License
User Mode Robot (I’ve checked the service, screenshot below with what I can see on our VM)
Unattended robot (resolutions set + login to console - set to no)

Error getting only when running from Orchestrator (for Take Screenshot activity - the one from this post)

Can you, please confirm that the only solution for us to make it work is to acquire the EE and use the MSI installer? (maybe to opt for the trial version meanwhile?)

Thank you!