Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When PowerToys is running as administrator, everything Run launches is also ran as administrator #3215

Closed
utybo opened this issue May 19, 2020 · 12 comments
Assignees
Labels
Hot Fix Items we will product an out-of-band release for Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@utybo
Copy link

utybo commented May 19, 2020

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

@saahmedm saahmedm added the Product-PowerToys Run Improved app launch PT Run (Win+R) Window label May 19, 2020
@crutkas crutkas added this to the v1.0 Release milestone May 19, 2020
@crutkas
Copy link
Member

crutkas commented May 19, 2020

Maybe hotfix

@crutkas
Copy link
Member

crutkas commented May 19, 2020

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

@Mortimersnodgrass
Copy link

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.

@crutkas
Copy link
Member

crutkas commented May 20, 2020

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.

@crutkas crutkas added the Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release. label May 21, 2020
@crutkas
Copy link
Member

crutkas commented May 22, 2020

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

@crutkas
Copy link
Member

crutkas commented Jun 4, 2020

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

@log1cb0mb
Copy link

I think v0.19.0 broke this again?

@utybo
Copy link
Author

utybo commented Jul 5, 2020

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

@log1cb0mb
Copy link

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?

@utybo
Copy link
Author

utybo commented Jul 6, 2020

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.

@log1cb0mb
Copy link

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?

@utybo
Copy link
Author

utybo commented Jul 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hot Fix Items we will product an out-of-band release for Product-PowerToys Run Improved app launch PT Run (Win+R) Window Resolution-Fix Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

6 participants