I’m facing an issue while taking the Screenshots via unattended BOT in Virtual Machine. It is giving me this exception.
System.ComponentModel.Win32Exception (6): 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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree) at UiPath.Core.Image…ctor(Region screenRegion)
This means that someone has logged into the server via RDP and then just closed the RDP window. You have to SIGN OUT from the start menu.
So now, log into the server via RDP (using the same account you’re running the automation with) and then sign out from the start menu. Now run the automation.
I have tried accessing the RDP and then sign out from the Start Menu but after I sign out, my ROBOT is also disconnected from that machine then I’m not able to run the BOT from the orchestrator.