Trigger:Cannot bring the target application in foreground because the windows session is locked

Hello All,

I used trigger with an unattended robot in RDP machine, and this robot is working then the session is open, but when it is disconnected , I get the error :slightly_frowning_face: :

“Cannot bring the target application in foreground because the windows session is locked”

Any one know how we resolve this issue please,?
Best regards


If the session is open then it should stay open or we should close it before the bot start and let bot take over completely…If we do in between the bot execution will be impacted

Please close and run the bot


Make sure you installed the robot in Unattended mode (Service Mode) by following the prerequisites from here Installing the Robot

In Orchestrator → Tenant → Manage Access → edit your robot → make sure that LoginToConsole is enabled and set to False

In robot machine make sure that you are logged out (not disconnected).

To log out, open cmd.exe and run logoff

I close it before the bot is started but same issue , I think there is other solution for this issue

Thank u
Best Regards


Is the robot installed in service mode?


1 Like

her the details from task manager


Can you find a Running service named UiRobotSvc?

1 Like

I have this, Best regards

This means you installed in Per User (User Mode).

You need to install it in Unattended mode (Service Mode).

Check here for instructions Installing the Robot


Have you another link please more clear ?
Because this one i did not undestanf the steps to follow corectly

Thabk u

What exactly you are not understanding?

You cannot add your robot username in those groups?

This is not something related only to UiPath products.

Computer Management is a collection of Windows administrative tools that you can use to manage a local or remote computer. The tools are organized into a single console, which makes it easy to view administrative properties and to gain access to the tools that are necessary to perform your computer-management tasks.

Try without prerequisites for now and continue to install the MSI file in Unattended mode.

With this not help in the end, return and follow the prerequisites chapter.


yes i add robot account into user management , do they mean I reinstall UiPath studio,

like this screenshot, thank you lot , Best Regards

From this screenshot, I see that you are just modifying the old installer components.

I recommend uninstalling it completely from Control Panel → Programs → Programs and Features

Then remove manually the below content if exists:

  • The settings in the folders %PROGRAMDATA%\UiPath, %LOCALAPPDATA%\UiPath, and %APPDATA%\UiPath
  • The content from %temp% folder
  • The packages folder %USERPROFILE%.nuget\packages
  • The NuGet cache folder %LOCALAPPDATA%\NuGet\v3-cache
  • The Assistant processes folder in the Windows Start menu %APPDATA%\Microsoft\Windows\Start Menu\Programs\UiPath Assistant Processes

Restart the Studio/Robot machine, and in the end, install in Unattended mode


After following the steps, I install unattended robot ,in services now I have this , is it the solution ? but I don’t have the studio UiPath in my laptop just the assistant and orchestrator ?is it the solution ? or we must install developer automation as type of robot also?

Best Regards , Thank you lot

If you don’t have the Studio installed, you can modify the installer from Control Panel and choose to add also Studio.

If you installed it in Unattended mode, that means your robot is in Service Mode.

Make your robot in Orchestrator an unattended robot also and in the Machine, template add an Unattended runtime for connection.

Then in the robot machine, logout from the robot account and schedule the process from Orchestrator.


I followed the steps, now i Have root unattended without UiPath studio,

now I try to see if the trigger works when I disconnect from the VM ,

In order to verify the good installation I can verify this from here ?and if i need to develop i MUST install UiPath as user mode developer automation?

Best regards
Thank you lot

If you are an Enterprise customer, raise a support ticket.

now it s working , just there is troubleshooting with chrome interraction,

i see how to reslve the issue , it will be resolved i think

Best regards

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