After checking multiple tutorials I had to take pieces from each of the following to get this to work on my Win10 system:
- https://www.howtogeek.com/165268/how-to-add-open-powershell-here-to-the-context-menu-in-windows/
- https://www.tenforums.com/tutorials/60175-open-powershell-window-here-context-menu-add-windows-10-a.html
Basically it uses the steps from the first article, but under the background
path from the second article.
Neither article on its own worked for me.
Steps:
-
Open regedit and go to path
HKEY_CLASSES_ROOT\Directory\background\shell
. -
Create new key
powershellmenu
. -
Change the
Default
value of thepowershellmenu
key to Open in PowerShell. (or whatever) -
Create new key
command
underpowershellmenu
. -
Change the
Default
value of thecommand
key to:C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'
-
Right-click on
powershellmenu
key and selectPermissions
, then set permissions toFull control
for the Administrators group. (or whatever group/user)
Then try right-clicking in some folder and it should work.
I found this page via Google. This is one of the first search results.
So... I wanted to start PS as administrator instead. I tried for an hour and ended up with this:
Here's a registry file for everyone. It adds the context entry everywhere. It adds the icon as well.
(Originally from WinaeroTweaker - but I didn't like that powershell was running "inside" CMD.exe)
And here is the version using Windows Terminal: