Issue in take a screenshot on VM

Dear All
We are trying to capture a screenshot on VM via orchestrator
We trigger the bot and got error like this
Object reference not set to an instance of an object
And sometimes we get
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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

Please give some suggestions…

2 Likes

Hello @Prashant_Rajput!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly
Forum_Staff

Dear All,

could you please confirm what is the below error while we are taking the screenshot on VM with Community Edition.

  1. We are using community Edition.
  2. run the job via orchestrator with unattended bot.

Please help us.

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

1 Like

Hi @akajayjakhar01

Do any of these topics help you a bit? Each contains a post marked as a solution to your error code:
https://forum.uipath.com/search?q=0x80004005%20status%3Asolved

Dear All,

could you please confirm what is the below error while we are taking the screenshot on VM with Community Edition.

  1. We are using community Edition.
  2. run the job via orchestrator with unattended bot.

Please help us.

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

Dear All,

could you please confirm what is the below error while we are taking the screenshot on VM with Community Edition.

  1. We are using community Edition.
  2. run the job via orchestrator with unattended bot.

Please help us.

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

I’ve merged the suspiciously identical entries into this single topic.

@loginerror could please provide exact solution for the below error still we tried with uninstall and reintall still we are facing same error on VM while taking screenshot via unattended bot in cummunity Edition.Please help us .

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)

Please find the steps:

  1. Push a package on orchestrator
  2. Run a Job at sheduled time on virtual machine via unattended bot and set the resolution in robot settting width =1920 height 1080 and depth =32 and login to console set it “No”
  3. After triggered unattended bot on Vm we are getting below error with take screenshot actvivity …

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.Vision.UiImage…ctor(Rectangle region, Int32 rotationDegree)
at UiPath.Core.Image…ctor(Region screenRegion)
@loginerror sir please help asap it will be greatful for us …

1 Like

We have disabled firewall and antivirus on VM as well and trigger the jon still we are facing same issue sir could you please help us also we uninstall ui and reinstall ui path facing same issue with take screenshot on VM.

Could you maybe provide some more information, as per this topic:
Forum FAQ - Information to provide when reporting a bug

First suggestion would be to update all activity packages to their latest versions.

@loginerror please find the atatchment we have updated all actvities still we are facing same issue.UIpathTakeScreenshotIssue.docx (103.9 KB)

Please note we are taking screenshot on virtual machine

Sir is there any update please help us @loginerror

It might be caused by the type of robot service that is used by the Community Edition, see here:

The solution could be to install the Robot as the The SCM-managed Robot service (UiPath.Service.Host.exe) via the MSI installer (it is available for download on your Cloud account).

Just keep in mind that the Studio version which comes with the MSI installer will be the latest Enterprise version and not equal to the current Community Edition (this means that sometimes projects made with latest version will not run on the older version of Robot).

Hello Sir @loginerror we downloaded.msi insatller where we can see that we need a license key for activation is there any way to get license key for trial or how to get it?

@loginerror How can i install on the target machine via the MSI installer Community Edition?

can you please share a url with us?

You should still be able to license your installation with a community license.

@loginerror sir I didn’t get you please can you confirm while I am installing .MSI installer from community edition orchestrator that time there is required licence key from where can I get licence key or is it possible without paid as trail version we can do it please help us we are stuck from long time still we don’t have solution please clear below things

  1. with community edition screen capture automation possible or not on virtual machine?

  2. if yes then please confirm how can we do it ? It will be fruitful for us to understand .

I believe it might not work as expected in some circumstances.

Could you post a screenshot of the splash screen that you see after you run Studio installed via the MSI installer? There should be an option there to allow you to license it with a Community license. This can also be done by connecting your Robot (via the Assistant) to Community Orchestrator.

@loginerror hello sir thanks for update we tried a install a .msi installer from community edition and after connecting machine to orchestrator trying to acquire license from orchestrator with community edition we are getting below error. we are folllowing below steps after installed .msi installer from community edition:

  1. orchestrator is connected to machine with machine key
  2. after that we are trying to start studio getting below error.

Please sir help us