Open Bash window here as administrator - Add in Windows 10  

Page 2 of 3 FirstFirst 123 LastLast
  1. Brink's Avatar
    Posts : 56,290
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #10

      My Computers


  2. Posts : 681
    Windows 10 x64 Pro
       #11

    HUGE request.

    Can anyone turn

    wsl_here_ubuntu.exe.reg

    into

    enable_open_bash_here_context_menu.reg

    basically i want the functionality of the latter, but with calling ubuntu as admin instead of the generic. Expanding on the former perhaps we'll call it?

    without knowing exactly what im looking at, and using a hex translator - it seems to work only on blank space, and uses ubuntu.exe -c bash as the command but i have no idea how to turn that into an "as admin" version across the board like the other script.

    If anyone can do so without much effort id be very grateful!
      My Computer

  3. Brink's Avatar
    Posts : 56,290
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #12

    klepp0906 said:
    HUGE request.

    Can anyone turn

    wsl_here_ubuntu.exe.reg

    into

    enable_open_bash_here_context_menu.reg

    basically i want the functionality of the latter, but with calling ubuntu as admin instead of the generic. Expanding on the former perhaps we'll call it?

    without knowing exactly what im looking at, and using a hex translator - it seems to work only on blank space, and uses ubuntu.exe -c bash as the command but i have no idea how to turn that into an "as admin" version across the board like the other script.

    If anyone can do so without much effort id be very grateful!

    Hello mate,

    Here you go. You can give this below a try to see how it may work for you.

    wsl_here_ubuntu_as_admin.reg

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wsl]
    @="Open WSL shell here as administrator"
    "Extended"=""
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wsl\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && ubuntu.exe -c bash' -Verb RunAs\""
      My Computers


  4. Posts : 681
    Windows 10 x64 Pro
       #13

    Brink said:
    Hello mate,

    Here you go. You can give this below a try to see how it may work for you.

    wsl_here_ubuntu_as_admin.reg

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wsl]
    @="Open WSL shell here as administrator"
    "Extended"=""
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wsl\command]
    @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && ubuntu.exe -c bash' -Verb RunAs\""
    Hey thank you brink. I'll give that a shot right away. All i needed was the command portion to supplant into the other. I had tried with changing out bash.exe for ubuntu.exe which worked, but seemed to just open the bash window.

    I imagine the -c bash is what I was missing. I wasnt sure if anything else would change and figured id better ask before i create a mess in my registry :)

    will report back shortly!

    - - - Updated - - -

    ok, that seems to be working :) That was the easy one. If you can solve this one, I'm forever in your debt and groveling! honestly. Believe it or not. I've been at this since 9am. Done two complete purges and image restores on two machines all in an attempt to get this working. 9 hours later and im feeling defeated having wasted an entire day.

    I dont know if your familiar with linux, or if thats even relevant, but here goes.

    open_with_bash_stay_open.reg

    that works perfectly to double click and run a .bash script. The problem is, when I click the "run as administrator" portion, I used to be greeted with the terminal window asking for my sudo password, the intended behavior.

    Now, im greeted with Open Bash window here as administrator - Add in Windows 10-image.png

    I'm unsure if something fundamental changed with the runas portion of the reg file, or if its something else.

    I have to concede to the pros
      My Computer

  5. Brink's Avatar
    Posts : 56,290
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #14

    @klepp0906,

    Great news on the first issue sorted.

    I'm not familiar enough with Linux for the second one though. You might create a new thread for it to see of someone may know though.
      My Computers


  6. Posts : 681
    Windows 10 x64 Pro
       #15

    Brink said:
    @klepp0906,

    Great news on the first issue sorted.

    I'm not familiar enough with Linux for the second one though. You might create a new thread for it to see of someone may know though.
    np :) Help is hard to find on that front. I hardly know where to look. I'll give it a shot here though and hope for the best. Thanks again <3
      My Computer

  7. Golden's Avatar
    Posts : 1,635
    Windows 10 Pro x64
       #16

    Brink said:
    You might create a new thread for it to see of someone may know though.
    @Brink - I asked Kari to have a look at that. If anyone can solve it, he will.
      My Computers

  8. Brink's Avatar
    Posts : 56,290
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #17

      My Computers


  9. Posts : 50
    10 pro
       #18

    When I tried it, cmd says "'bash.exe' is not recognized as an internal or external command,
    operable program or batch file."
    I'm running Windows 10 pro, version 1909 (OS build 18363.752)
    Do I need to download & install bash, or is something else wrong?
      My Computer

  10. Brink's Avatar
    Posts : 56,290
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #19

    SpacemanSam said:
    When I tried it, cmd says "'bash.exe' is not recognized as an internal or external command,
    operable program or batch file."
    I'm running Windows 10 pro, version 1909 (OS build 18363.752)
    Do I need to download & install bash, or is something else wrong?
    Hello Sam.,

    Correct. The "Open Bash window here" context menu item requires that Bash on Unbunto is enabled to work..
      My Computers


 
Page 2 of 3 FirstFirst 123 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 Discussions
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 18:18.
Find Us




Windows 10 Forums