valinet / ExplorerPatcher

This project aims to enhance the working environment on Windows
GNU General Public License v2.0
23.5k stars 1.02k forks source link

Opening Windows PowerShell (Admin) from context menu opens powershell unprivileged #2156

Open sudoeste opened 11 months ago

sudoeste commented 11 months ago

Right clicking start icon (or pressing win +x) and selecting Windows PowerShell (Admin) should open powershell in admin mode but opens unprivileged.

After doing that, rightclicking the same windows start menu icon (or once again pressing win + x) will crash explorer.exe.

This bug exists since the early days of ExplorerPatcher

pyrates999 commented 11 months ago

Does it prompt you to elevate when you try to open Windows PowerShell (Admin)?

Please post windows version and build. You can find this by running winver. Please post explorer patcher version.

Please include what settings you changed in explorer patcher properties application.

sudoeste commented 11 months ago

No, it doesn't prompt uac.

Every version of explorer patch, every version of windows, stock settings. The bug exists since the very first version I tried

pyrates999 commented 11 months ago

Please post windows version and build. You can find this by running winver. Please post explorer patcher version.

Please include what settings you changed in explorer patcher properties application.

sudoeste commented 11 months ago

As I said, it happens in every windows 11 version and build for at least a year. It also happens in every Explorer Patcher version for at least a year.

You don't have to change any option, just install Explorer Patcher and the problem is there, it's terribly simple to reproduce as it happens always

pyrates999 commented 11 months ago

Please post windows version and build. You can find this by running winver. Please post explorer patcher version.

If you don't provide this, then this may be closed due to not enough information provided.

sudoeste commented 11 months ago

Winver: 22621.2283 Explorer patcher: 22621.2283.57.2

As I said happens in every single windows and patcher version without changing any option for more that a year.

PaienNate commented 10 months ago

Winver: 22621.2361 With 22621.2361.58.4 seems have the same error.

Tom-McW commented 10 months ago

Winver: 22H2 (OS Build 22621.2428 EP: 22621.2361.58.4 I have 2 machines exhibiting the same issue. Both machines have the same winver and EP are the same on both machines. I cannot get elevated PowerShell on either machine. Also, Explorer restarts when right clicking start button the first time, then works correctly the second time but still won't give me Admin privileges on powershell. If I run a windows command prompt as administrator it gives me the UAC window and allows me to work as administrator.

pyrates999 commented 10 months ago

Winver: 22H2 (OS Build 22621.2428 EP: 22621.2361.58.4 I have 2 machines exhibiting the same issue. Both machines have the same winver and EP are the same on both machines. I cannot get elevated PowerShell on either machine. Also, Explorer restarts when right clicking start button the first time, then works correctly the second time but still won't give me Admin privileges on powershell. If I run a windows command prompt as administrator it gives me the UAC window and allows me to work as administrator.

Please file the start menu crash as a new issue. Include the windows version and build and the EP version installed like you did here.

BLumia commented 7 months ago

Winver: Windows 11 Home, 23H2 (22631.3007) Explorer patcher: 22621.2861.62.2

Steps to reproduce:

  1. Install ExplorerParcher
  2. Switch taskbar style to Windows 10 taskbar style
  3. Right-click the start menu button to open the context menu
  4. Click on Windows PowerShell (Administrator)
  5. An unprivileged PowerShell window (on my machine it's a Windows Terminal window) will open
  6. Re-do step 3 and step 4
  7. Explorer will crash

This only happens when using Windows 10 taskbar style. When using Windows 11 taskbar style, the admin powershell context menu entry works fine.

pyrates999 commented 7 months ago

Winver: Windows 11 Home, 23H2 (22631.3007) Explorer patcher: 22621.2861.62.2

Steps to reproduce:

  1. Install ExplorerParcher
  2. Switch taskbar style to Windows 10 taskbar style
  3. Right-click the start menu button to open the context menu
  4. Click on Windows PowerShell (Administrator)
  5. An unprivileged PowerShell window (on my machine it's a Windows Terminal window) will open
  6. Re-do step 3 and step 4
  7. Explorer will crash

This only happens when using Windows 10 taskbar style. When using Windows 11 taskbar style, the admin powershell context menu entry works fine.

Check what happens when using the console in explorer patcher. Open up the properties application for explorer patcher, go to advanced, and click on enable console.

BLumia commented 7 months ago

Check what happens when using the console in explorer patcher. Open up the properties application for explorer patcher, go to advanced, and click on enable console.

Well... seems nothing special:

https://github.com/valinet/ExplorerPatcher/assets/10095765/f515b04c-086f-4864-a7a7-18f2c5dd06c9

As you can see, I tried to reproduce this issue 2 times. Console log can also be found in this video. Let me know if you need any additional information.

pyrates999 commented 7 months ago

Can you copy and paste the text from the EP console to here?

BLumia commented 7 months ago

Can you copy and paste the text from the EP console to here?

Sure:

Running on Windows 11, OS Build 10.0.22631.3007.
Loaded symbols
Setup user32 functions done
CAppResolverCacheBuilder::_AddUserPinnedShortcutToStart() = 47780
Patched taskbar transparency in newer OS builds
ITrayUIHost = 3B2318
explorer.exe!TrayUI_CreateInstance() = 19B6DC
Setup explorer functions done
Setup uxtheme functions done
[AC] rcMonitorAssignment = 247F1
[AC] rcWorkAssignment = 248A1
[AC] blockBegin = 24806
[AC] blockEnd = 248B7
[AC] Patched!
[CC] rcMonitorAssignment = 66EFB
[CC] rcWorkAssignment = 66FC8
[CC] blockBegin = 66F13
[CC] blockEnd = 66FE1
[CC] Patched!
[TC] rcMonitorAssignment = 5B6A0
[TC] rcWorkAssignment = 5B756
[TC] blockBegin = 5B6BA
[TC] blockEnd = 5B76F
[TC] Patched!
[TV] firstCallPrep = 2F665
[TV] firstCallCall = 2F66F
[TV] Patched!
[HC] match1 = 1D56D
[HC] match2 = 1D634
[HC] writeAt = 1D22E
[HC] cleanup = 1D645-1D65A
[HC] Patched!
PenMenuSystemTrayManager::GetDynamicSystemTrayHeightForMonitor() = 45D430
Setup twinui.pcshell functions done
Setup combase functions done
Setup twinui functions done
Setup stobject functions done
Setup bthprops functions done
Setup pnidui functions done
Setup shell32 functions done
Setup windows.storage functions done
[IME] Context menu patch status: 1
Setup inputswitch functions done
wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_TaskbarMultiMon_38545217>::__private_IsEnabled() = 10BEB8
Setup windowsudk.shellcommon functions done
Setup peopleband functions done
Installed hooks.
Play startup sound thread...
Signal shell ready...
Started "Signal shell ready" thread.
Open Start on monitor thread
EP Service Window thread
Started "Open Start on current monitor" thread.
Initialized taskbar centering module.
Registered Win+A, Win+B, and Win+N
Progman: 1969906
Progman hook: 131657
[Positioning] Added settings for monitor 0000000000010001 : 0
>>> Signal shell ready.
Setup sndvolsso functions done
Ended "Signal shell ready" thread.
Started "Play startup sound" thread.
Ended "Play startup sound" thread.
0 0
[Updates] Starting daemon.
[Updates] Configured update policy on this system: "Check for updates but let me choose whether to download and install them".
[Updates] Path to module: C:\WINDOWS\dxgi.dll
[Updates] Checking against hash "22622.2861.62.2.c2b7c0292fff8608"
[Updates] Update URL: https://github.com/valinet/ExplorerPatcher/releases/latest/download/ep_setup.exe

To be clear it is the log shown after ExplorerPatcher is restored from crash. The log is completely empty when the unprivileged PowerShell is shown instead of crashing. Since this issue is very easy to reproduce, I suggest follow https://github.com/valinet/ExplorerPatcher/issues/2156#issuecomment-1895817541 to try to reproduce.

pyrates999 commented 7 months ago

Ok, thanks. Please wait for a developer to respond.

ascendbeing commented 6 months ago

This happens to me. With Windows 11 23H2, win+x+a+enter doesn't uac no prompt, and launches user permissions terminal or power shell. doesn't matter if I click it or press enter or a key. Uninstalled explorer patcher, rebooted. works now. prompts me unlike with this installed.

gregkotsaftis commented 6 months ago

I enabled the console. When i right click on START with windows 10 taskbar style, the explorer restarts and the log output is below: (with win11 taskbar style, this issue does not occur!)

Running on Windows 11, OS Build 10.0.22631.3155.
Loaded symbols
Setup user32 functions done
CAppResolverCacheBuilder::_AddUserPinnedShortcutToStart() = 47480
Patched taskbar transparency in newer OS builds
ITrayUIHost = 3BB318
explorer.exe!TrayUI_CreateInstance() = 1A447C
Setup explorer functions done
Setup uxtheme functions done
[AC] rcMonitorAssignment = 396C1
[AC] blockBegin = 396D6
[AC] blockEnd = 39787
[AC] Patched!
[CC] rcMonitorAssignment = 34CBB
[CC] rcWorkAssignment = 34D88
[CC] blockBegin = 34CD3
[CC] blockEnd = 34DA1
[CC] Patched!
[TC] rcMonitorAssignment = 355D0
[TC] blockBegin = 355EA
[TC] blockEnd = 3569F
[TC] Patched!
[TV] firstCallPrep = 24E35
[TV] firstCallCall = 24E3F
[TV] Patched!
[HC] match1 = 1D56D
[HC] match2 = 1D634
[HC] writeAt = 1D22E
[HC] cleanup = 1D645-1D65A
[HC] Patched!
PenMenuSystemTrayManager::GetDynamicSystemTrayHeightForMonitor() = 480A40
Setup twinui.pcshell functions done
Setup combase functions done
Setup twinui functions done
Setup stobject functions done
Setup bthprops functions done
Setup pnidui functions done
Setup shell32 functions done
Setup windows.storage functions done
[IME] Context menu patch status: 1
Setup inputswitch functions done
wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_TaskbarMultiMon_38545217>::__private_IsEnabled() = 110E68
Setup windowsudk.shellcommon functions done
Setup peopleband functions done
Installed hooks.
Play startup sound thread...
Signal shell ready...
Started "Signal shell ready" thread.
Open Start on monitor thread
Started "Open Start on current monitor" thread.
EP Service Window thread
Initialized taskbar centering module.
[Positioning] Added settings for monitor 0000000000010001 : 0
Registered Win+A, Win+B, and Win+N
Progman: 459364
Progman hook: 786605
0 0
>>> Signal shell ready.
Setup sndvolsso functions done
Ended "Signal shell ready" thread.
Started "Play startup sound" thread.
Ended "Play startup sound" thread.
[Updates] Starting daemon.
[Updates] Configured update policy on this system: "Check for updates but let me choose whether to download and install them".
[Updates] Path to module: C:\Windows\dxgi.dll
[Updates] Checking against hash "22622.3007.63.3.7638f76208571b7c"
[Updates] Update URL: https://github.com/valinet/ExplorerPatcher/releases/latest/download/ep_setup.exe
[Updates] Hash of remote file is "22622.3007.63.3.7638f76208571b7c" (valid).
[Updates] Local version obtained from hash is 22622.3007.63.3.
[Updates] No updates are available.
k23450987 commented 5 months ago

I enabled the console. When i right click on START with windows 10 taskbar style, the explorer restarts and the log output is below: (with win11 taskbar style, this issue does not occur!)

Running on Windows 11, OS Build 10.0.22631.3155.
Loaded symbols
Setup user32 functions done
CAppResolverCacheBuilder::_AddUserPinnedShortcutToStart() = 47480
Patched taskbar transparency in newer OS builds
ITrayUIHost = 3BB318
explorer.exe!TrayUI_CreateInstance() = 1A447C
Setup explorer functions done
Setup uxtheme functions done
[AC] rcMonitorAssignment = 396C1
[AC] blockBegin = 396D6
[AC] blockEnd = 39787
[AC] Patched!
[CC] rcMonitorAssignment = 34CBB
[CC] rcWorkAssignment = 34D88
[CC] blockBegin = 34CD3
[CC] blockEnd = 34DA1
[CC] Patched!
[TC] rcMonitorAssignment = 355D0
[TC] blockBegin = 355EA
[TC] blockEnd = 3569F
[TC] Patched!
[TV] firstCallPrep = 24E35
[TV] firstCallCall = 24E3F
[TV] Patched!
[HC] match1 = 1D56D
[HC] match2 = 1D634
[HC] writeAt = 1D22E
[HC] cleanup = 1D645-1D65A
[HC] Patched!
PenMenuSystemTrayManager::GetDynamicSystemTrayHeightForMonitor() = 480A40
Setup twinui.pcshell functions done
Setup combase functions done
Setup twinui functions done
Setup stobject functions done
Setup bthprops functions done
Setup pnidui functions done
Setup shell32 functions done
Setup windows.storage functions done
[IME] Context menu patch status: 1
Setup inputswitch functions done
wil::details::FeatureImpl<__WilFeatureTraits_Feature_Servicing_TaskbarMultiMon_38545217>::__private_IsEnabled() = 110E68
Setup windowsudk.shellcommon functions done
Setup peopleband functions done
Installed hooks.
Play startup sound thread...
Signal shell ready...
Started "Signal shell ready" thread.
Open Start on monitor thread
Started "Open Start on current monitor" thread.
EP Service Window thread
Initialized taskbar centering module.
[Positioning] Added settings for monitor 0000000000010001 : 0
Registered Win+A, Win+B, and Win+N
Progman: 459364
Progman hook: 786605
0 0
>>> Signal shell ready.
Setup sndvolsso functions done
Ended "Signal shell ready" thread.
Started "Play startup sound" thread.
Ended "Play startup sound" thread.
[Updates] Starting daemon.
[Updates] Configured update policy on this system: "Check for updates but let me choose whether to download and install them".
[Updates] Path to module: C:\Windows\dxgi.dll
[Updates] Checking against hash "22622.3007.63.3.7638f76208571b7c"
[Updates] Update URL: https://github.com/valinet/ExplorerPatcher/releases/latest/download/ep_setup.exe
[Updates] Hash of remote file is "22622.3007.63.3.7638f76208571b7c" (valid).
[Updates] Local version obtained from hash is 22622.3007.63.3.
[Updates] No updates are available.

reproduced it. winver: 22631.3227 ExplorerPatcher version: 22621.2861.62.2

ascendbeing commented 5 months ago

I figured out (with latest stable, didn't try the one I had the problem with, but it happens just like it if I don't do this) how to resolve:

  1. Change default windows 10 taskbar to windows 11 from EPer properties page
  2. Restart explorer shell from properties page
  3. Now you can win+x a and have admin take effect and you also don't have to be wacky and right click or left click after having done the key combo

Hope that helps. Maybe they can fix the win 10 bar to workaround the issue, but you can enjoy at least a lot of the functions of this software, by opting to use the win 11 taskbar (EPer defaults to 10 whether or not you're on 11/server 2022)

yatli commented 5 months ago

Same issue, been experiencing this since the early days of ep. FWIW, "Terminal (Admin)" right below it works: image The key combo win-x a a enter is becoming part of my muscle memory.

lsd-techno commented 1 month ago
EP Version: 22621.3810.66.1
Win 11 Pro: Build 22621.ni_release.220506-1250

If right click on start menu then select Windows PowerShell or Windows PowerShell (Admin) it opens non elevated terminal window with PowerShell tab, in same time or when attempt to right click once more on start button EP hangs then restarts.

pyrates999 commented 1 month ago

Please run winver to get the windows version and build number.

BLumia commented 1 month ago

Windows 23H2 22631.3880 can still reproduce the very same issue, with the exact same reproduce steps that are already provided above.

@pyrates999 did you try to reproduce this issue on your own? If you did, does that mean on your device it works without issue? And if that's the case, what's your OS's detailed information (like system version and other information that you've asked to provided)? In such a way we might be able to narrow down the condition that might cause the issue to happen.

pyrates999 commented 1 month ago

It works in windows 10. I tested it with the win+x menu where it had powershell (admin) and with the EP option changing win+x to show command prompt (admin). Both worked.

I don't run windows 11 due to it's UI design choices. And because it has ads in the OS.

My windows 10 version is 19045.4651. I run EP version 22621.3527.65.5.

sudoeste commented 1 month ago

It works in windows 10. I don't run windows 11 due to it's UI design choices. And because it has ads in the OS.

Hi! As I wrote here previously the bug happens in every windows 11 version ever released with every single patcher version released.

Some already posted versions but the bug it reproducible 100% of the time using Windows 11 so I don't understand why we are always being asked for affected versions.

pyrates999 commented 1 month ago

It's useful to know what versions it is happening on. It's part of software development basics when trying to fix a bug or add a new feature.

sudoeste commented 1 month ago

I do understand that, I work with developers. There are many versions already reported and specified above. But I'll go a step further.

The affected versions are: Explorer Patcher ANY version when used in conjunction with Win11 ANY version.

pyrates999 commented 1 month ago

and are you running an english version of windows 11 or a non-english version of windows 11? Because some bugs only happened on non-english versions of windows 11.

sudoeste commented 1 month ago

Tried in Portuguese (pt-pt) and English (en-GB). I even tried a win 11 VM image in a (cant remember) provider.

It happens always and is 100% reproducible

pyrates999 commented 1 month ago

Please wait for a developer to respond.

lsd-techno commented 1 month ago

Please run winver to get the windows version and build number. 1721585480523

It works in windows 10. I tested it with the win+x menu where it had powershell (admin) and with the EP option changing win+x to show command prompt (admin). Both worked.

I don't run windows 11 due to it's UI design choices. And because it has ads in the OS.

My windows 10 version is 19045.4651. I run EP version 22621.3527.65.5.

The purpose that we attempt to use EP is to override UI restrictions for taskbar and start menu invented in win 11.

By the way, how to find ads in win 11?

All OSes are en-GB and/or en-us localized.

pyrates999 commented 1 month ago

https://www.pcmag.com/news/microsoft-pushes-start-menu-ads-to-windows-11-users

lsd-techno commented 4 weeks ago

https://www.pcmag.com/news/microsoft-pushes-start-menu-ads-to-windows-11-users

Never notice any ads there... Anyway built-in start menu into win 11 is useless by design. So EP is a chance for users to switch to win11, so not only PC observers will be able to use it :)