How to start PowerShell from Windows Explorer

There are times where we need to start the Windows PowerShell inside the specific directory and start running the PowerShell commands. Usually, we type the command “PowerShell” in windows run to open PowerShell and then use the CD command to change the directory. This article explains on How to start PowerShell from Windows Explorer.

Well, there are many ways to open the PowerShell from windows explorer. The different approaches are listed below.

How to start PowerShell from Windows Explorer

Approach 1: Using Windows Explorer Address Bar

In Windows Explorer, just go to the Address Bar at the top (keyboard shortcuts: Alt+D or Ctrl+L) and type powershell or powershell_ise and press Enter. A Powershell command window opens with the current directory.

Approach 2: Using Explorer menu option

If you’re on Windows 8, or later, you can simply use the built-in File -> “Open Windows Powershell”
Or Alt + F followed by R

Approach 3: Create a custom Context Menu option

As an alternative to the answer above, which requires you to type the PowerShell command (powershell.exe) each time, you can create a context menu entry just like with the “Open command window here” context menu.

There are three registry keys where these commands go. Each key controls the context menu of a different Windows Explorer object. The first one is the one you asked about:

  • HKCR\Directory\Background\shell – This is the context menu for the Explorer window itself (that is, the context menu that is displayed when no item is selected, such as when right-clicking in an empty area of the window).
  • HKCR\Directory\shell – This is the context menu of the folders in Windows Explorer.
  • HKCR\Drive\shell – This is the context menu for the drive icons in the root of Windows Explorer.

For each of these registry keys, you can add a subkey that will add an “Open PowerShell window here” command to the context menu, just as you have an “Open command window here” context menu.

Here is a copy of my OpenPowerShellHere.reg file, which puts the command in the context menu of each of the Explorer objects, the window background, the folder, and the drive icon:

Save this into a file and name it as “PowerShell.reg”, double click on the file, when the prompt appears to add the registry key click on proceed.

Right click on any folder after that and you will be able to see the option named “Open PowerShell Window here“.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.