System.Runtime.InteropServices.COMException (0x80070520) A specified logon session does not exist 0x80070520 - Troubleshoot Steps



Issue Description

Executor start process failed, reason System.Runtime.InteropServices.COMException (0x80070520): A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520)

Please follow the below 4 guideline and make the changes.

a) Config RDP timeout to create user session
If UIPATH_SESSION_TIMEOUT is not defined , define the value and set it to 120.

Steps defined in the above link (In case the link doesn’t work )
Description: The UIPATH_SESSION_TIMEOUT environment variable should be defined on Windows system variable and represent the seconds to wait for a user session. If is not defined, default timeout (30 seconds) will be used. After set the UIPATH_SESSION_TIMEOUT environment variable, an restart of UiRobot service must be performed.


  1. In windows open Run and execute: SystemPropertiesAdvanced
  2. Click on Environment Variables


  1. In the System variables section add new variable

image.png650x594 4.92 KB

  1. Restart the UiRobot SVC

b) Verify if the Robot user and the everyone is added to the below policies. In case not please add it. (Screenshot for reference)
-Access this computer from the network
-Allow log on locally
-Allow log on through Remote Desktop Services.
-Log on as a batch job

c) Navigate to system properties and verify if the below options are selected for the system

d) %programdata% / UiPath / UiPath.Settings file changes

  • Verify the value of logintoconsole if set to “false” ? This is essential when you are executing process in unattended mode.
  • Also make sure the proper resolution setting has been defined i.e. height, width & depth.

The below snapshot shows the configuration done in my machine for the Robot to execute in unattended mode with a specific resolution. The resolution is taken from the dev environment where workflow was developed and applied on the Robot machine in UAT/ PROD environment.

Robot machine:

  1. Login to the robot machine.
  2. Open uipath folder under program data. Add in UIPath.settings file the height depth and width that you have noted in the appropriate parameters. Logintoconsole: false (small f)
  3. Restart uipath robot services (Run -> services.msc -> Uipath Robot -> Restart)
  4. Reboot the machine.
  5. Logoff from the system.

Note : Every single steps is equally important. After setting up all the configuration , you can leverage the functionality of HD.


Hi, I followed the 4 steps described and we are still getting the same “A specified logon session does not exist. It may already have been terminated” Error.


Hi Diego.
For a single robot running on the machine (meaning the Operating System of the robot machine is Windows Desktop - i.e. Windows 7, windows 8, windows 10) you don’t need Login To Console to be set to false. It’s even advised to set it to true.
What is the most important: you should sign out all the users from that machine. No active session should exist. If you do this, you increase the chances for the “UiPath Robot” Windows Service to be able to create a console session.
By the way, I assume you don’t use the community edition of UiPath Studio/Robot, where there is no windows service “UiPath Robot”. Only the service can create the session if started from Orchestrator.
Please find attached screenshots from a PPT guide that explains what to check.
There is no need to add “Everyone” for the right “Access this computer from the network” as long as the group “Users” is still there. All users are members of the group Users.
There is no need for “Logon as a batch job”.



4) The next picture was obtained by running UiRobot.exe --EnableLowLevel, followed by opening the .etl file in SawBuck.
You can see that the Service could not create the session for the user srvsysrobott01 because another user cph075009 was logged in and the robot machine is a Windows Desktop OS, does not support two sessions at the same time.


Hi Am getting this issue in Excel read range activity
_Test has thrown an exception

Source: Excel application scope

Message: Exception from HRESULT: 0x800A03EC

Exception Type: ExcelException

UiPath.Excel.ExcelException: Exception from HRESULT: 0x800A03EC —> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC
at Microsoft.Office.Interop.Excel._Workbook.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local)
at UiPath.Excel.WorkbookApplication…ctor(String workbookPath, String password, Boolean visible, Boolean autoSave, Boolean createNew, String editPassword, Boolean readOnly)
— End of inner exception stack trace —
at UiPath.Excel.WorkbookApplication…ctor(String workbookPath, String password, Boolean visible, Boolean autoSave, Boolean createNew, String editPassword, Boolean readOnly)
at UiPath.Excel.Activities.ExcelApplicationScope.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)