I shift-right-click a folder in File Explorer and click "Open powershell window here" but it opens in: C:\WINDOWS\system32 instead
1 Answer
The context-menu entry in the registry is badly configured.
The following .reg
file should repair it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell]
@="Open PowerShell window Here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'"
I suggest first to use regedit
and compare the above with the contents at key
HKEY_CLASSES_ROOT\Directory\shell\powershellmenu
,
before running it.
-
Edited to fix doubled-up slashes & add `\Background` to registry path. You really don't need to supply a path to registered apps but tt doesn't hurt. Commented Apr 3, 2021 at 19:05