Powertoys: When PowerToys is running as administrator, everything Run launches is also ran as administrator

Created on 19 May 2020  路  12Comments  路  Source: microsoft/PowerToys

Environment

Windows build number: 10.0.19041.264
PowerToys version: 0.18.0
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run

Steps to reproduce

  • Go to the Settings and choose "Restart as administrator"
  • Use Alt+Space to open PowerToys Run
  • Launch "Powershell" or "Windows Terminal" without clicking on Run's "run as administrator"
  • Run the following script
function Test-IsAdmin {
    ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
}

if (!(Test-IsAdmin)){
    throw "Please run this script with admin priviliges"
}
else {
    Write-Host "Got admin"
}

Script taken from https://www.jonathanmedd.net/2014/01/testing-for-admin-privileges-in-powershell.html

Expected behavior

  • PowerShell runs normally and running this script does not work

Actual behavior

  • The window title shows "administrator" and the script succeeds: we are running as an administrator.

Screenshots

Expected

image

Actual

image

Hot Fix Product-Launcher Resolution-Fix-Committed

Most helpful comment

my thought here is launcher is should not be run elevated. it has rippling effects.

apps from it can be elevated but even if runner is elevated, Launcher shouldn't

All 12 comments

Maybe hotfix

my thought here is launcher is should not be run elevated. it has rippling effects.

apps from it can be elevated but even if runner is elevated, Launcher shouldn't

Just possibly more information. Quicken 2016 complained that it will not run properly if run as administrator which rippled down from launcher. I was not expecting Quicken to run as administrator when I had powertoys run as admin.

we're working on a hotfix for this right now. hoping will be checked in early tomorrow AM and we can do a full release tomorrow.

We just released 0.18.1 which will have this fix included in it.

fixed in 0.18.2 official release. https://github.com/microsoft/PowerToys/releases/

I think v0.19.0 broke this again?

Not on my side, I can't reproduce this on 0.19 (the Windows Terminal windows was launched with PT Run)
image

I am trying for e.g notepad/notepadd++ which are not being executed as Admin. I am basically trying the apps for which i do not have explicitly set to "Run as Administrator" under advanced properties and if i understood this right, that was the whole idea behind this feature/change?

No, this issue was about the "Run as administrator" feature of Powertoys that you can find under the General options. Basically, the Powertoys process needs admin privileges because of a few features which won't work properly with windows that have admin privileges (e.g. FancyZones might not be able to move some windows whose process have admin privileges).

When the Powertoys process was running as administrator (to make FancyZones work properly in those cases for example), it accidentally caused everything launched with Powertoys Run to be ran as administrator, even when you don't click on the button that's specifically for that.

image

The intended behavior was that you have to click on that button to launch the thing as an administrator. But as I explained before, it would be ran as administrator even without clicking on the button if Powertoys itself was running as administrator, which was a bug.

Ah right, makes sense. I thought it was about eliminating the need of specifically clicking that Run As Administrator button when launching app through Run. I misread the title, and specifically RAN part. I read it as RUN. :/

But now speaking of using that Run As Admin option in Run without the need of using mouse to click on the button, would be nice to have a shortcut key to launch the app as Admin for e.g Alt+Enter. Or such shortcut is already there and I have not yet figured it out?

Ctrl + Shift + Enter is the shortcut you're looking for 馃槈 (it's the same shortcut as Windows' regular search functionality)

Was this page helpful?
0 / 5 - 0 ratings