How-To Geek

How to Add “Open PowerShell Here” to the Right-Click Menu for a Folder in Windows


If you’re a fan of using Windows PowerShell rather than the Command Prompt, you might enjoy being able to access it right from the context menu you get when you right-click a folder in Windows. Here’s how to make it happen.

Windows already includes an “Open command window here” option when you Shift+click a folder. PowerShell offers a more powerful feature set, though, especially if you do any kind of automation through scripting. If you do prefer PowerShell, you either have to open PowerShell and then navigate to the folder or use the command from the menu in File Explorer. Instead, why not add an “Open PowerShell window here” option to the same context menu? It’s easy to do. You just have to dive into the Windows Registry for a couple of quick edits.

Add “Open PowerShell Window Here” to the Context Menu by Editing the Registry Manually

To add an “Open PowerShell Window Here” option to the context menu, you just need to make a couple of quick edits in the Windows Registry.

Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.

Open the Registry Editor by hitting Start and then typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.


In the Registry Editor, use the left sidebar to navigate to the following key:



Next, you’ll create a new key inside the shell key. Right-click the shell key and choose New > Key. Name the new key “powershellmenu.” We’re naming our new key powershellmenu because in Windows 8 and 10 (and as you can see in our screenshot), a Powershell key already exists that serves other functions.


Now, you’ll change the (Default) value inside the new powershellmenu key. With the powershellmenu key selected, double-click the (Default) value to open its properties window.


In the properties window, set the value in the “Value data” box to “Open PowerShell Here” and then click “OK.” This gives the command the name that will appear on the context menu.


Optionally, you can also set the command so that it only appears if you hold Shift down while right-clicking a drive—much the same way that the “Open Command Prompt” command is hidden unless you Shift+right-click a folder. To to that, right-click the powershellmenu key and choose New > String Value. Name the new value “Extended.” You don’t need to make any changes to it. Just having that string there will cause the command to be hidden behind Shift key access.


Whether you took the optional step of creating the Extended value or not, the rest of the process is the same. You’ll next need to create a new key inside your powershellmenu key. Right-click the powershellmenu key and choose New > Key. Name the new key “command.”


Now, you’ll change the  (Default) value inside the new command key. With the command key selected, double-click the (Default) value to open its properties window.


The (Default) value specifies the actual command that will run when you select the option on the context menu. Type the following text into the “Value data” box and then click “OK.”

C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath '%L'


The changes should take place immediately, so you can exit out of Registry Editor. To test it out, just right-click (or Shift+right-click if you set up that option) any folder and make choose the ”Open with PowerShell” command.


The PowerShell window should open immediately and, after a few moments, place you inside the folder you right-clicked.


If you want to reverse the changes at any time, just go back into the Registry and delete the powershellmenu key that you created. This will automatically delete any values and other keys you created inside the powershellmenu key and remove the command from your context menu.

Download Our One-Click Registry Hacks


If you don’t feel like diving into the Registry yourself, we’ve created some registry hacks you can use. The “Add PowerShell to Context Menu” hack adds the PowerShell command to the regular context menu. The “Add PowerShell to Shift Context Menu” adds the PowerShell command to the context menu you get when you use Shift+right-click. And the “Remove PowerShell from Context Menu” removes the command no matter which way you added it. All three hacks are included in the following ZIP file. Double-click the one you want to use and click through the prompts.

PowerShell Context Menu Hacks

These hacks are really just the powershellmenu key, stripped down to the additional keys and values we talked about in the previous section and then exported to a .REG file. Running the hacks just modifies the value. And if you enjoy fiddling with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.

Taylor Gibb is a Microsoft MVP and all round geek, he loves everything from Windows 8 to Windows Server 2012 and even C# and PowerShell. You can also follow him on Google+

  • Published 01/9/17

More Articles You Might Like