cancel
Showing results for 
Search instead for 
Did you mean: 

Attach to User Account Control Window

TimsySangal
Level 4
Hi All,

I am trying to run a powershell command that opens a configuration file.After the command gets executed ,a User Account Control(UAC) window shows up.I have to select the "Yes" option on this window and only then does the file open.I have set the UAC notification setting to notify(Do not dim screen).I am not able to attach to this window using the window title(i have tried using wildcards also) or the process name(consent.exe).

When I set the UAC notification settings to Never Notify,the process works fine.But i don't want to change the notification settings.

Please help.
18 REPLIES 18

Hi John,

I am still stuck here.

------------------------------
Consultant
Capgemini
------------------------------

Anonymous
Not applicable
​maybe this can help. https://stackoverflow.com/questions/49393850/attach-blueprism-to-powershell

StackOverflow can help you 

------------------------------
Cohen
RPA Developer

Romania
------------------------------

Hi Ionut,

Thank you for your response.

I am able to attach to powershell but not able to attach to the pop-up window that appears after running this command on powershell(User Account Control is enable on the system)-

powershell -c start -verb runas notepad.exe C:\Windows\System32\drivers\etc\hosts

When I disable UAC, the notepad file is launched but Blue Prism does not get attached to this instance of notepad.

In both these cases,it throws the same error-"could not open the target application"

------------------------------
Consultant
Capgemini
------------------------------

Windows creates a Secure Desktop for running UAC prompt, attaching to it is not possible. Global send keys, Global mouse click by attaching to explorer won't work. 
Your only option is to disable the prompt.

------------------------------
Gopal Bhaire
Analyst
Accenture
------------------------------

Hi Gopal,

Thank you for your response.

The UAC settings are currently set to-Notify me only when apps try to make changes to my computer(do not dim my desktop).

The "do not dim my desktop" option does not take over the desktop and allows us to continue to work on other application.Is a secure desktop created in this case as well?

------------------------------
Consultant
Capgemini
------------------------------

I guess yes it creates a secure desktop even when notify is set to do not dim, this is to prevent programs from running in admin mode without user consent (try alt tab you won't see the prompt).

In a BP prod environment the VM will be secured and maintained by only a few who are authorized, so setting the notify to off shouldn't be an issue.

Also a workaround:
1. Run Task Scheduler in admin mode
2. Create a task corresponding to what you're trying to achieve
3. Set the task to run with highest privilege
4. Then use Start process Process Name SCHTASKS  Arguments /Run /TN "TaskName"



------------------------------
Gopal Bhaire
Analyst
Accenture
------------------------------

Hi Gopal,

Thank you for the response.I will try this workaround and share the updates with you.

Thank you!

------------------------------
Consultant
Capgemini
------------------------------

Hi Timsy,

Can you resolve this? I'm with the same problem.


------------------------------
Consultant
Yank Solutions
------------------------------

------------------------------
Olavo Neto
------------------------------

Hi Olavo,

We created a new account for which the UAC settings were disabled(set to Never Notify).The pop does not show up in this case and then the host file can be edited by opening it in admin mode using PowerShell commands.

------------------------------
Timsy Sangal
Consultant
Capgemini
------------------------------