How to add Powershell shortcut to Windows right-click context menu [Tip]

Powershell is an alternative command-line tool to the Command Prompt in Windows. This article discussed how to add a Command Prompt shortcut to the context menu. You can also add a Powershell shortcut to the context menu by adding a couple of registry entries.

Enter regedit in the Start Menu’s search box, and click its shortcut to open the window below. Windows 8 users can enter regedit in the Run text box by pressing the Win key + R. As an alternative to regedit, check out Reg covered in this article.

powershell context menu5

Browse to HKEY_CLASSES_ROOT\Directory\shell in the registry window. Then right-click the shell sub key, select New and Key. Enter “powershell” as the key’s title.

powershell context menu

Next, right-click its default value and select Modify from the context menu. That will open the window below where you input “Open PowerShell Here” in the Value data field. Press the OK button to close window.

powershell context menu2

Right-click on the powershell sub key, select New > Key and enter command as its title. Then right-click the command sub key’s default value and select Modify to open the window below. There enter C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command Set-Location -LiteralPath ‘%L’.

powershell context menu3

If Windows isn’t installed on the C drive, edit the path accordingly. In addition, the v1.0 number should match your own Powershell version number. You can find out the version number by entering C:\Windows\System32\WindowsPowerShell in Windows Explorer’s address bar.

Now close the registry editor window. Open Windows Explorer and right-click a folder to open the context menu. The context menu will include a Powershell option on it as shown below. That option opens the folder path in Powershell.

powershell context menu4

Now you can open folders in Powershell directly from their context menus. That’s a handy shortcut for Powershell users. To further customize Powershell, you may refer to this article.

Related Posts