Published by


Brink's Avatar
Administrator

Posts: 32,374

Show Printable Version 


How to Add or Remove "Open Linux shell here" context menu in Windows 10


The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.

This is primarily a tool for developers -- especially web developers and those who work on or with open source projects. This allows those who want/need to use Bash, common Linux tools (sed, awk, etc.) and many Linux-first tools (Ruby, Python, etc.) to use their toolchain on Windows.

WSL provides an application called Bash.exe that, when started, opens a Windows console running the Bash shell. Using Bash, you can run command-line Linux tools and apps.

Bash is a popular text-based shell and command-language. It is the default shell included within Ubuntu and other Linux distros, and in macOS. Users type commands into a shell to execute scripts and/or run commands and tools to accomplish many tasks.

Starting in Windows 10 build 17672, a new Open Linux shell here context menu is available when you have Windows Subsystem for Linux (WSL) enabled and installed a Linux distro app.

By default, the Open Linux shell here context menu is only available when you press and hold the Shift key and right click or press and hold on a folder or drive.

For more details about Windows Subsystem for Linux (WSL) and Bash on Ubuntu, see:

This tutorial will show you how to add or remove the Open Linux shell here context menu for all users when Windows Subsystem for Linux (WSL) is enabled in Windows 10.

You must be signed in as an administrator to add or remove the "Open Linux shell here" context menu.


EXAMPLE: "Open Linux shell here" context menu
Name:  Open_Linux_shell_here.png
Views: 588
Size:  16.6 KB
Name:  Open_Linux_shell_here_command_prompt.png
Views: 577
Size:  21.4 KB



Here's How:

1. Press the Win+R keys to open Run, type regedit into Run, and click/tap on OK to open Registry Editor.

If you have already changed the owner and set permissions for the registry keys in step 2, step 3, and step 4 below, then you can skip ahead to step 6 below instead.

2. Navigate to the key below in the left pane of Registry Editor, and: (see screenshots below step 4)

HKEY_CLASSES_ROOT\Directory\Background\shell\WSL

A) If you have not already, you will need to change the owner of the WSL key in the left pane to be the Administrators group. Be sure to check both Replace owner of subcontainers and objects and Replace all child object permission entries with inheritable permission entries from this object.

B) Click/tap on Yes to confirm.

C) If you have not already, you will need to set permissions of the WSL key in the left pane to "Allow" the Administrators group "Full control".

3. Navigate to the key below in the left pane of Registry Editor, and: (see screenshots below step 4)

HKEY_CLASSES_ROOT\Directory\shell\WSL

A) If you have not already, you will need to change the owner of the WSL key in the left pane to be the Administrators group. Be sure to check both Replace owner of subcontainers and objects and Replace all child object permission entries with inheritable permission entries from this object.

B) Click/tap on Yes to confirm.

C) If you have not already, you will need to set permissions of the WSL key in the left pane to "Allow" the Administrators group "Full control".

4. Navigate to the key below in the left pane of Registry Editor, and: (see screenshots below)

HKEY_CLASSES_ROOT\Drive\shell\WSL

A) If you have not already, you will need to change the owner of the WSL key in the left pane to be the Administrators group. Be sure to check both Replace owner of subcontainers and objects and Replace all child object permission entries with inheritable permission entries from this object.

B) Click/tap on Yes to confirm.

C) If you have not already, you will need to set permissions of the WSL key in the left pane to "Allow" the Administrators group "Full control".

Name:  Advanced_security-1.png
Views: 581
Size:  24.3 KB Name:  Advanced_security-2.jpg
Views: 578
Size:  84.4 KB
Name:  Advanced_security-3.png
Views: 575
Size:  14.4 KB Name:  Advanced_security-4.png
Views: 575
Size:  29.2 KB

5. When finished, you can close Registry Editor.

6. Do step 7 (add-right click), step 8 (add-Shift+right click) , or step 9 (remove) below for what you would like to do.


 7. To Add Right Click "Open Linux shell here" Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 10 below.

Add_Open_Linux_shell_here_context_menu.reg

download


 8. To Add Shift + Right Click "Open Linux shell here" Context Menu

This is the default setting.

A) Click/tap on the Download button below to download the file below, and go to step 10 below.

Add_Shift+Open_Linux_shell_here_context_menu.reg

download


 9. To Remove "Open Linux shell here" Context Menu

A) Click/tap on the Download button below to download the file below, and go to step 10 below.

Remove_Open_Linux_shell_here_context_menu.reg

download

10. Save the .reg file to your desktop.

11. Double click/tap on the downloaded .reg file to merge it.

12. When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

13. You can now delete the downloaded .reg file if you like.


That's it,
Shawn