# Sherpa Assistant: Frequently Asked Questions

## Reasons for Robot/Selector Errors on a Remote Machine When Disconnected from RDP

**Questions:**

1. Why does the Robot stop working when launched on a remote machine after disconnecting from it?
2. Sometimes errors occur with selectors on the remote machine. I disconnect from RDP using the closerdpsession program, but it doesn't help.

**Answer:**

**Possible Solutions:**\\

1. Launch the Assistant and find the menu item in the tray: "Tools" -> "Disconnect from the current RDP session".

<figure><img src="https://3212714295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0zUnKkOuy6lWt7DZ46u%2Fuploads%2Fgit-blob-e56750550a4a0a642d4caaaac318f5c76237de81%2F2025-03-20_16-41-19.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Right-click on the Sherpa Assistant shortcut on the desktop and navigate to the program folder:

<figure><img src="https://3212714295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0zUnKkOuy6lWt7DZ46u%2Fuploads%2Fgit-blob-ef5bf279b3585c963dc503767bf6e608de29006b%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(218).png?alt=media" alt=""><figcaption></figcaption></figure>

There, find the program `closerdpsession.exe` and create a shortcut to it on the desktop.

<figure><img src="https://3212714295-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FI0zUnKkOuy6lWt7DZ46u%2Fuploads%2Fgit-blob-33208921fd8963bc4ddeeea048e5cdffe5423a1d%2F%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5%20(219).png?alt=media" alt=""><figcaption></figcaption></figure>

Exit the connection not by closing the RDP window, but by double-clicking the shortcut for the program `closerdpsession.exe`.

<table data-header-hidden><thead><tr><th width="50"></th><th></th></tr></thead><tbody><tr><td><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeQen14pdiop7RJrYpYOTl9yVKOcPICJ8fH6vRAXjNOh66NSp4wWFFSiy4nQlvs9wkmXPItas_gGsxzuu5J1ypxbhXdUyKiAk1jCPfIv6UdaKCIPWVvaWuVpXSB7o2i6WdUVMacsg?key=Xplr0gVoyx3tqpkkXjZLx1lq" alt="" data-size="line"></td><td>This way, you can only exit from one machine. Administrator rights are required to run the program.<br>We do not guarantee complete and 100% operation of the Robot on the RDP machine when you disconnect from it via the Assistant or the program <code>closerdpsession.exe</code>.</td></tr></tbody></table>

When disconnecting, the User's session switches to the console (this is a "workaround" used to keep the User's context open). However, how the console behaves and what can happen to it over time is unknown (this information is not disclosed by Microsoft).

It should also be noted that since there is only one console, if another User connects to the same machine via RDP (or by another method), Windows disconnects the console from the other connected User.

<table data-header-hidden><thead><tr><th width="58"></th><th></th></tr></thead><tbody><tr><td><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeQen14pdiop7RJrYpYOTl9yVKOcPICJ8fH6vRAXjNOh66NSp4wWFFSiy4nQlvs9wkmXPItas_gGsxzuu5J1ypxbhXdUyKiAk1jCPfIv6UdaKCIPWVvaWuVpXSB7o2i6WdUVMacsg?key=Xplr0gVoyx3tqpkkXjZLx1lq" alt="" data-size="line"></td><td>It is recommended to use Unattended robots, which do not have this problem.</td></tr></tbody></table>

## Can the Robot Work with a Locked Screen?

**Question:** Can the Robot work with a locked screen?

**Answer:**

Yes, it can.\
\
There are several nuances related to interactive work with the graphical user interface (GUI) in Robot scripts. In particular, if the interface is not displayed, the ability to interact with it from the Robot script becomes impossible. However, if you switch the graphical context of the session to the console using the `closerdp` program, it will appear to the User as if the screen is locked, while the work with the GUI will continue correctly.

## How Can I Launch a Robot from Application Code in C# and Pass Necessary Parameters to It?

**Question:** I have an application written in C#. At a certain point, I need to launch a robot from the code and also pass specific parameters to it. Can I launch a .robot file and pass parameters for execution?

**Answer:** Follow the instructions [Setting Up Input and Output Parameters in Project Properties](https://github.com/KonstantinMastak/SherpaDocs/blob/main/En/sherpa-rpa/sherpa-designer/sherpa-designer-otvety-na-chasto-zadavaemye-voprosy/nastroika-vkhodnykh-i-vykhodnykh-parametrov-v-svoistvakh-proekta.md).
