Open Bash window here as administrator - Add in Windows 10  

Page 1 of 2 12 LastLast
    Open Bash window here as administrator - Add in Windows 10

    Open Bash window here as administrator - Add in Windows 10

    How to Add 'Open Bash window here as administrator' context menu in Windows 10
    Published by Category: Customization
    17 May 2018
    Designer Media Ltd


    How to Add 'Open Bash window here as administrator' context menu in Windows 10

    information   Information
    Microsoft first made investments that improve cmd, PowerShell, and many other command-line tools and developer scenarios. Second Microsoft decided to grow their command line family by adding real, native Bash and with it support for Linux command-line tools which run directly on Windows in an environment that behaves like Linux!

    Starting with Windows 10 Insider Preview Build 14316, you can natively run Bash in Windows. BASH is a popular text-based shell and command-language. It is the default shell included within Ubuntu and other Linux distroís, and in OSX. Users type commands into a shell to execute scripts and/or run commands and tools to accomplish many tasks.

    You can now run Bash scripts, Linux command-line tools like sed, awk, grep, and you can even try Linux-first tools like Ruby, Git, Python, etc. directly on Windows. You can also access your Windows filesystem from within Bash allowing you to work on the same set of files using your preferred Windows tools or Linux command-line tools.

    For more details about Bash, see:

    This tutorial will show you how to add or remove a Open Bash window here as administrator context menu for all users in Windows 10.

    Note   Note
    You must be signed in as an administrator to add, remove, or use the "Open Bash window here as administrator" context menu.

    The "Open Bash window here" context menu item requires that Bash on Unbunto is enabled to work. Bash on Unbunto is not enabled by default in Windows 10.

    The "Open Bash window here" context menu will be available when you right click or shift + right click on a folder or drive, and when you right click or shift + right click on the background of a folder, drive, library, or desktop.


    EXAMPLE: "Open Bash window here as administrator" context menu
    Click image for larger version. 

Name:	Open_Bash_window_here_as_administrator_context_menu.png 
Views:	306 
Size:	40.1 KB 
ID:	96003
    Name:  Bash_on_Ubuntu_on_Windows.png
Views: 7080
Size:  6.4 KB




    Here's How:

    1. Do step 2 (add-right click), step 3 (add-Shift+right click) , or step 4 (remove) below for what you would like to do.


     2. To Add Right Click "Open Bash window here as administrator" Context Menu

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

    Add_Open_Bash_window_here_as_administrator_context_menu.reg

    download


     3. To Add Shift + Right Click "Open Bash window here as administrator" Context Menu

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

    Add_Shiift+Open_Bash_window_here_as_administrator_context_menu.reg

    download


     4. To Remove "Open Bash window here as administrator" Context Menu

    NOTE: This is the default setting.

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

    Remove_Open_Bash_window_here_as_administrator_context_menu.reg

    download

    5. Save the .reg file to your desktop.

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

    7. If prompted, click on Run, Yes (UAC), Yes, and OK to approve the merge.

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


    That's it,
    Shawn


  1.    #1

    Hi again brink :)

    It possible to make this without the shield icon? Perhaps with the bash icon? Iíd swoon!
      My ComputerSystem Spec

  2. Brink's Avatar
    Posts : 40,673
    64-bit Windows 10 Pro build 18932
    Thread Starter
       #2

    Hello klepp, :)

    Here's one without the UAC icon.

    Add_Open_Bash_window_here_as_administrator_context_menu.reg
      My ComputersSystem Spec

  3.    #3

    The Shield Icon means it requires administrator privs. It can't (to my knowledge) be set to something else without replacing it globally (ie some kind of imgres replacement) . You can remove the admin privs, as Brink has done, but you can't use a custom icon.
      My ComputerSystem Spec

  4. Brink's Avatar
    Posts : 40,673
    64-bit Windows 10 Pro build 18932
    Thread Starter
       #4

    The icon in the context menu can be any icon you want, or can be removed. It won't affect it from running as administrator. :)
      My ComputersSystem Spec

  5.    #5

    You are the man :)

    Thank you!

    Any chance thereís a tutorial around about how to change the icon? Appreciate your removing the shield for me :)

    If i can add the bash icon and learn something along the way that would be great.

    #bow
      My ComputerSystem Spec

  6. Brink's Avatar
    Posts : 40,673
    64-bit Windows 10 Pro build 18932
    Thread Starter
       #6

    You're most welcome.

    You can edit the .reg file, add the "Icon" lines, and replace the bit in red below with the full path of the .ico file you want to use.

    Code:
    Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\BashAsAdmin]
    @="Open Bash window here as administrator"
    "Extended"=-
    "HasLUAShield"=-
    "Icon"="full path of .ico file"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\BashAsAdmin\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && bash.exe' -Verb RunAs\""
    
    
    [HKEY_CLASSES_ROOT\Directory\shell\BashAsAdmin]
    @="Open Bash window here as administrator"
    "Extended"=-
    "HasLUAShield"=-
    "Icon"="full path of .ico file"
    
    [HKEY_CLASSES_ROOT\Directory\shell\BashAsAdmin\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && bash.exe' -Verb RunAs\""
    
    
    [HKEY_CLASSES_ROOT\Drive\shell\BashAsAdmin]
    @="Open Bash window here as administrator"
    "Extended"=-
    "HasLUAShield"=-
    "Icon"="full path of .ico file"
    
    [HKEY_CLASSES_ROOT\Drive\shell\BashAsAdmin\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && bash.exe' -Verb RunAs\""
    
    
    [HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\BashAsAdmin]
    @="Open Bash window here as administrator"
    "Extended"=-
    "HasLUAShield"=-
    "Icon"="full path of .ico file"
    
    [HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\BashAsAdmin\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && bash.exe' -Verb RunAs\""
    Last edited by Brink; 19 Mar 2018 at 09:18. Reason: updated
      My ComputersSystem Spec


  7.    #7

    I feel guilty for bugging you, I apologize!

    First thing in the morning Iíll see if I canít find where windows stashes that little red three circle icon and it should be easy peasy beyond that.

    Sincere gratitude :)
      My ComputerSystem Spec

  8.    #8

    found it! for those interested

    "C:\\Program Files\\WindowsApps\\CanonicalGroupLimited.UbuntuonWindows_1604.2017.922.0_x64__79rhkp1fndgsc\\images \\icon.ico"

    Thanks brink :)
    Last edited by klepp0906; 19 Mar 2018 at 06:30.
      My ComputerSystem Spec

  9.    #9

    hrm I get

    cannot import (path to file): The specified file is not a registry script. You can only import binary registry files from within the registry editor.

    EDIT - fixed. Has to have Windows Registry Editor Version 5.00 header, didnt realize that was integral :)
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Tutorial Categories

Open Bash window here as administrator - Add in Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


Related Threads
How to Add "Open command window here as administrator" context menu in Windows 10 A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands at the command prompt, you can perform tasks on...
How to Add 'Open Bash window here' context menu in Windows 10 Microsoft first made investments that improve cmd, PowerShell, and many other command-line tools and developer scenarios. Second Microsoft decided to grow their command line family by...
When I want to open some picture in windows 10 photo viewer he open separate window with some album and other stuff, and I don't want that, I just want to see that photo that I open. I am really struggling with this new photo viewer, is there any...
Hello all! I've got two new problems with Windows on my laptop. First off - When running any kind of video that is in Chrome (Only browser that I've tested so far) or in MPlayerClassic my graphics driver continuously crashes and makes some really...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:36.
Find Us