CoreyHayward / PowerToys-Run-ClipboardManager

PowerToys Run Plugin enabling searching of the clipboard history and pasting the selected item.
MIT License
140 stars 5 forks source link

Can't paste into programs running with elevated priviliges. #3

Closed MaverickMartyn closed 6 months ago

MaverickMartyn commented 7 months ago

Pasting to a program running as administrator doesn't work, even while running PowerToys as admin. It can be easily reproduced using Notepad.

CoreyHayward commented 7 months ago

Thanks for reporting, I have been able to re-create this and will take a look when I get a chance

CoreyHayward commented 6 months ago

@MaverickMartyn Apologies for the delay in getting round to this. It looks as though the root cause of this issue is in how PowerToys Run dynamically loads in the plugins meaning as far as I can tell they don't run as administrator even when PowerToys itself has been configured to run as administrator.

I have implemented a workaround for this so that you can properly paste into an administrative program using the context menu (CTRL+SHFT+ENTER) which hopefully will help you out until I can either look at the root issue in PowerToys Run or someone else does! Unfortunately this workaround forces the UAC prompt each time its executed but I thought that it would be better than nothing!

CoreyHayward commented 6 months ago

Just for further reference, it looks like this is a feature of PowerToys and not a bug based on issues from the PowerToys Repo. PowerToys Run is always forced to run as a non-administrative level to prevent every single operation being executed as admin (see the 'fix' here https://github.com/microsoft/PowerToys/issues/3215) therefore the implemented solution is likely the only way this can be achieved.