Are you a developer and often use Bash on Windows 10?
Do you want to access folders from Bash easily from the context menu?
The Bash was added to Windows 10 in the Anniversary Update. This feature allowed developers and power users to benefit from the tools and commands that Linux (ubuntu) provide. This major step took place in order to encourage developers and Linux enthusiasts to upgrade or migrate to Windows 10 since you can’t get Bash natively on older versions of Windows.
Bash in Windows 10 is an optional feature so it isn’t built-in like the Command Prompt. If you wish to run Bash as admin from the context menu, and be capable to open it in any folder you should do a Registry trick which you will discover in this tutorial.
1. How to Enable Bash on Windows 10
Before you may run Bash as admin, you have to be sure you’ve installed it. The method is pretty easy; allow developer mode within the Settings app under For Developers. You’ll need admin rights to allow it.
After you turn it on, open the “Control Panel” > “Programs and features” and click on “Turn Windows features on or off“.


Check in the list the option “Windows Subsystem for Linux“. Click “OK“.

Now go to Microsoft Store and search for Ubuntu. Click “Get“, then “Install“.



Launch Ubuntu from the Start menu.

It will install itself automatically, just enter your desired username and password.

Now that we have installed Bash, let’s see how we can enable accessing it from the context menu on any folder on your system.
2. How to Edit Registry to Run Bash as Admin
It’s fairly straightforward to run Bash as admin however it simply isn’t doable from the right-click context menu. You possibly can launch the Bash app from the Windows Search menu or the Start menu however you can’t open it immediately in a folder.
Open the Registry Editor by typing regedit
in Run (Windows+R)

Use the arrows on the left side of keys to navigate to this path in the Registry Editor.
HKEY_CLASSES_ROOT\Directory\shell
Create a brand new key under the key “shell” named “AdminBash“. The brand new key may have a default string worth.

Select the newly created key “AdminBash” and double-click on the “(Default)” string value and give it the following value:
Run Bash As Admin
You may give it any name you want, just make sure it’s clear that it’s clearly describing its primary function.

Subsequent, within the AdminBash key you created, create another key and title it “command“. Inside this key, just like the earlier one, there’s a string referred to as “(Default)“. Double-click it and alter the value of it to the following:
powershell -c start -verb runas cmd '/c start /D """%V""" bash.exe'


Do the same in this path to enable the context menu when you right-click on empty space in an actual folder:
HKEY_CLASSES_ROOT\Directory\Background\shell\

Restart explorer.exe
for good measure.
To do this open the Task Manager using CTRL+SHIFT+ESC.
Choose explorer.exe
from Details and click “End task“.

Launch it again by going to “File” > “Run new task“.
Type explorer
in the window “Create new task” and click “OK“.

Right-click on a folder and choose “Run Bash Ad Admin“. You can also right-click inside a folder…

There you have it!
I hope this tutorial helped you improve your productivity and earn some time using Bash on Windows 10!
Feel free to share this tutorial with your friends, sharing is caring.
Be the first to leave a comment !