Getting Error Cannot bring the target application in foreground because the Windows session is locked

Hi Community Users,

I am getting the error Cannot bring the target application in the foreground because the Windows session is locked. while running the code from the orchestrator in unattended mode. However all the activities are working fine before the Ui Interaction.

And other processes are also running fine on the same VM because they are not using the Ui Automation.

Can you please suggest some workaround for this.

I really appreciate any help you can provide.

@Yankit_Singh_R

Please check if robot is installed in service mode or not…

For ui to work service mode or unattended robot installation is needed

Open task manager check for uipathservicehost.exe service if not install in unattended or service mode

Cheers

Hi @Anil_G

Thanks for the reply.

Only these processes are appearing in task manager-

Is it in User mode?

@Yankit_Singh_R

You need to open services page and check there…not on processes tab

Cheers

Hi @Anil_G

Thanks for the reply.

There is no service in VM as you mentioned uipathservicehost.exe.

@Yankit_Singh_R

Then your robot is installed in usermode…you would see uipathuserhost.exe that means it cannot run ui automation in background or u attended…so please reinstall the robot in service mode

Cheers

Hi @Yankit_Singh_R

As @Anil_G suggested, you need to install the robot in service mode to run the bot for UI automation in unattended mode.

The video below will provide you with an overview of how to install the robot in service mode,

Hope it helps!!

Hi @Anil_G

Thanks for the solution.

1 Like

Hi @mkankatala

Thanks for the help.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.