How to overcome this error message in Studio: "Cannot access application '.'. Elevated privileges might be required. Try running the UiPath application as an administrator."?
Let’s assume that you are trying to automate via UiAutomation an elevated application, but the Studio application it’s displaying a warning "Cannot access application '.'. Elevated privileges might be required. Try running the UiPath application as an administrator.".
What may be the cause?
The issue is due to that the target application which you are automating needs a higher privilege to interact with it.
How may I overcome this behavior?
You may have a couple of solutions in this case:
- Run the target application in a non-elevated mode or low Integrity level after which the UiPath Robot will be able to identify the application elements.
- Automatically start UiPath Executor as admin (Robot user should have administrator access) suitable configurations should be performed at GPO Level. Check with your IT admin team to perform the changes with your organization’s approval. Be informed that UiPath never recommends starting UiPath as admin, due to security concerns.
Resolution
Solution 1 → Run the target application in a non-elevated mode or low Integrity level after which the UiPath Robot will be able to identify the application elements.
Approach #1
- Create a .txt file with this information
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@="Run without privilege elevation"
[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@="cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"%1\"\""
- Save/Rename this text file as <name_of_file>.reg and add it to the Windows Registry. (Double-clicking on it should do the trick.)
Results in the Registry Editor:
- Afterwards, right-click the app (for example you have a console.msc file or the mmc.exe console) you’d like to run without administrative privileges and select “Run without privilege elevation”.
In some cases, a small amount of 0.1% of programs may ask twice about the UAC prompt.
Example:
Now in Studio, it will allow you to check and play with the target application.
You may switch to Modern Design Experience in the case you are using the Classic Mode. Set to Yes the Modern Design Experience in your Project Settings and then Reload the project.
After use the reload has been performed, you may use the Use Application/Browser activity.
Results (the target UiElements are recognized now by the UiPath client services):
Approach #2
If you have a particular application (in the below case is presented as the mmc.exe process) that you want to always run without UAC, you can target it with the Registry (add the text to a REG file and import it into the Registry):
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\Windows\\SysWOW64\\mmc.exe"="RunAsInvoker"
Result of running the above registry.
After, when you will run the mmc console, it will run as Elevated mode set to No.
Example:
Solution 2 → Make UiPath Robot interact with application, running with Admin rights in Unattended mode.
When running the Robot from Orchestrator, UiPath Robot runs without Admin rights and it can only interact with the applications which are running with the same integrity level.
If the target application is running with a higher elevation, the error “Cannot automate the application, as the target application is with elevated mode” is obtained.
In order to automatically start UiPath Executor as admin (Robot user should have administrator access), suitable configurations should be performed at GPO Level. Check with your IT admin team to perform the changes with your organization’s approval. Be informed that UiPath never recommends starting UiPath as admin, due to security concerns.
To run the UiPath service as Admin, make the below changes in policies:
- Run gpedit.msc as Administrator to open the Local Group Policy Editor.
- Expand Computer Configuration → Windows Settings → Security Settings → Local Policies → Security Options.
- Set “User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode” to Elevate without prompting.
- Set “User Account Control: Detect application installations and prompt for elevation” to Disabled.
- Set “User Account Control: Run all administrators in Admin Approval Mode” to Disabled.
- Set “User Account Control: Only elevate UIAccess applications that are installed in secure locations” to Disabled
-
After performing these changes, restart the machine.
-
After the machine starts, make sure that the UiPath Robot service is Running. If it is not running, Start this service and check if the Robot is connected to Orchestrator in order to run your automation.