PowerToys: Power Rename - Endless Explorer.exe crash loop when renaming User Directory
Environment
**Windows build number:** Microsoft Windows [Version 10.0.18363.720]
**PowerToys version:** Version v0.15.2
PowerToy module for which you are reporting the bug (if applicable): Power-Rename
Steps to reproduce
- go to C:/Users
- Rightclick user profile folder.
- Power Rename.
Expected behavior
Either a rename, if I am allowed, OR, a message to say that I’m unable.
Note that explorer.exe hides the rename option, which is why I tried to power rename it.
Actual behavior
Explorer.exe will hang for a short time, but then will get into a crash-kill-boot loop and the computer has to have a hard restart.
Screenshots
Can’t be bothered to do it again but you should be able to understand what a crashing explorer looks like. 😃
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (14 by maintainers)
PowerRename should check each item passed to it has SFGAO_CANRENAME capability. We should check the passed payload for at least one item that has SFGAO_CANRENAME enabled (see IShellItem::GetAttributes) before even showing the context menu item. Also, this should be checked in the code logic as well, not just in the QueryContextMenu call. I’m curious about the crash in Explorer. I’ll try this out on a VM when I get a chance.
This isn’t just the User profile folder. Other “special” folders are protected in the same way - like the Windows folder.
It is PT enabling a no-no scenario. We need to be defensive against that.
Yeah, we need to add in some safety rails here. Great catch