1

I shift-right-click a folder in File Explorer and click "Open powershell window here" but it opens in: C:\WINDOWS\system32 instead

enter image description here

1 Answer 1

1

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.

1
  • 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .