Add PowerShell to a folder's context menu
On Windows, I want the ability to call PowerShell by right-clicking onto a folder.
Not a problem, open PowerShell for the last time from the start menu. Reminder: It's under "W" like "Windows PowersHell".
Call the command regedit:
Select HKEY_CLASSES_ROOT -> Folder -> shell -> PowerShell -> command. Put in cmd /K cd %L && powershell
Now start Windows Explorer and right-click on any folder there. You will see "PowerShell" in the context menu:
If you click on it, you will be in the respective folder in PowerShell:
What did we do here?
We added a key to the Windows Registry. This is the central key-value store for all Windows programs, mostly storing configuration data. In this case Windows Explorer will consume the config data for displaying context menus on a folder.
The key is "Default" and it will be executed. The value is cmd /K (run a command) cd %L (change to the directory handed over in the variable L) && (if the previous command was successful, run the following command) powershell (call PowerShell).
Post a Comment