How to Quickly Launch a Bash Shell From Windows 10’s File Explorer

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 1

Launch Bash on Windows 10 and it will automatically open to your UNIX account’s home folder. Rather than using the cd command to change to another folder, you can launch Bash directly from a folder in File Explorer.

You can do this without any registry hacks or changes. It’s just hidden. But if you’re willing to dive into the registry, you can make it a little more convenient. Here are our two recommended methods.

The Easy Option: Use the Address Bar

When you want to launch bash at a specific folder, just navigate to that folder in File Explorer normally. Click the address bar while in that folder, type “bash”, and press Enter.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 2

You’ll get a Bash prompt window focused in the folder you selected.

For example, if you type “bash” directly in the root of the C: drive, Bash will open with the directory /mnt/c selected.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 3

The Right-Click Option: Add a Context Menu Option by Editing the Registry

Perhaps you’d rather have a context menu option like the “Open command window here” option that appears when you hold Shift and right-click inside a folder in File Explorer.

To get this kind of Bash shortcut, you’ll need to edit the registry and add this feature yourself. If you’d rather not do this by hand, we have a quick .reg file you can run below instead.

RELATED ARTICLEShow-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 4Learning to Use the Registry Editor Like a Prohow-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 5How to Backup and Restore the Windows Registry

Standard warning: The 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.

First, open the registry editor by pressing the Windows key, typing “regedit” into the Start menu, and pressing “Enter”.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 6

Navigate to the following key:

HKEY_CLASSES_ROOT\Directory\Background\shell

Right-click the “shell” key and select New > Key.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 7

Name the key “bash” or something similar. You can name it anything you want. This name doesn’t appear in Windows anywhere, and is just used to keep track of the entry in the registry.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 8

Select “bash” (or whatever you named the key) in the left pane.

Double-click “(Default)” in the right pane and enter whatever name you want to appear in File Explorer’s context menu. For example, you could enter “Open a Bash shell here” or just “Bash”.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 9

If you want the Bash entry to have an icon in File Explorer’s context menu, right-click the “bash” key and select New > String Value.

Name the value “Icon”, double-click it, and enter the following value:

%USERPROFILE%\AppData\Local\lxss\bash.ico

Skip this step and don’t create an “Icon” value at all if you don’t want an icon in the menu.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 10

Next, right-click the “bash” key and select New > Key.

Name it “command”.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 11

With the “command” key selected in the left pane, double-click “(Default)” in the right pane and enter the following value:

C:\Windows\System32\bash.exe

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 12

You’re done. You can now right-click a folder in File Explorer and select “Open a Bash shell here” (or whatever you named the option) to quickly open a Bash shell to that specific folder. This option will appear immediately, so you don’t have to sign out or reboot first.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 13

Use Our One-Click Registry Hack

Rather than doing all the registry editing work above, you can download our one-click .reg file. It does the exact same thing the above registry hack does. If you decide you want to remove the option, we’ve also included a one-click .reg file that will quickly remove the option.

Download our one-click “Add Bash to Your Context Menu” registry hack and unzip the file. Double-click the “Add Bash to Your Context Menu.reg” file and agree to add the information to your registry to get the context menu option. Double-click the “Remove Bash From Your Context Menu.reg” file if you ever want to remove the option.

how-to-quickly-launch-a-bash-shell-from-windows-10-and-8217;s-file-explorer photo 14

You should only add registry files from sources you trust. If you’re ever curious about what a .reg file does, you can right-click it in Windows and select “Edit” to inspect the .reg file and see exactly what information it will add or remove from your registry.

Article How to Quickly Launch a Bash Shell From Windows 10’s File Explorer compiled by Original article here

More stories

The Great Debate: Is it Linux or GNU/Linux?

You will usually see the Linux operating system referred to as “Linux” online. However, the term “GNU/Linux” is occasionally used instead. Linux and GNU/Linux refer to the same operating system and software, and there’s a controversy over which term is more appropriate.

How to Enable Developer Settings on Android Auto

It’s no secret that Google likes to keep developer options hidden away in most of its products—there’s no reason to have casual users tinkering around there, after all. But if you like to tinker (or are, of course, a developer), then this hidden menu can be a lot of fun.

Six Ways to Get the Most Out of Your GoPro

Whether you’re on vacation or just spending a fun afternoon at the park, a GoPro can turn any activity into an interesting story with the right tools and know-how. Here’s how to get the most out of your GoPro camera.