Cannot bring the target application in the foreground. The action was blocked by the current foreground window ‘New notification’ from the process ‘shellexperiencehost.exe’

Hi Team,

I got this error.

Cannot bring the target application in the foreground. The action was blocked by the current foreground window ‘New notification’ from the process ‘shellexperiencehost.exe’.

Please suggest how to resolve this.

Thanks in advance.

Hi @bhanusai_sajja

Please give a try on the following approaches

Windows server Level

Turn off notifications temporarily or for specific apps.

  • Settings → SystemNotifications
  • Turn OFF:
  • Notifications
  • Focus assist summary
  • App banners
  • Tips & suggestions

Or turn off for individual apps like:

  • Outlook
  • Teams
  • OneDrive
  • Windows Security

This alone solves the issue in 90% of cases.

Code Level

  • Add Use Application/Browser → properties:
    • WindowMode = None
    • Activate = True
    • BringToFront = True

Inside it, place the UI activity.

Happy Automation

Hi @Christopher_R,

Thanks for the response.

I have set Get notifications from apps and other senders to Off in my VM. Does it resolve the issue.

Thanks in advance.

@bhanusai_sajja Yes that should work..

However, to fully avoid this issue, I still recommend you also apply the code‑level fix:

  • Open your Use Application/Browser activity
  • Set:
    • WindowMode = None
    • Activate = True
    • BringToFront = True

This ensures UiPath can focus the window even if something else tries to appear on top.

Please test it once, if issye still continues , Happy to help you further.

@bhanusai_sajja

Make sure you have installed the robot in Service Mode.

If correctly installed in service mode then make sure you login into the machine manually and then sign out. Don’t just close the session.

After this run the bot and observe.