You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't start elevated process in non-elevated bash #1237
A brief description
WSL since Build 14951 allows launching Windows binaries in Bash. But I cannot launch a Windows binary, such as regedit.exe which requires UAC elevation from a non-elevated bash.
Expected results
I expect to see a UAC elevation confirmation dialog box when starting a privileged process, or auto-elevate for files like regedit.exe if my UAC setting is the default level.
Actual results (with terminal output if applicable)
Silently fail (without launching the process nor displaying error).
Your Windows build number
Build 10.0.14951
Steps / All commands required to reproduce the error from a brand new installation
Set Windows UAC setting to the default level
Launch bash.exe (don't run it as administrator)
Run the following commands in bash: export PATH=$PATH:/mnt/c/Windows and then mnt/c/Windows/regedit.exe
Registry Editor is not launched, and no error message is given.
NextPrime (@nextprime) I think what would be ideal is if we could do something like "winsudo" that calls up a UAC prompt (in general for powershell stuff too).
fpqc "winsudo" is an interesting idea but I feel like it is potentially a can of worms. I think if you need to run admin things from within bash you should just run bash.exe elevated.
I'm looking at adding some error text for when the binfmt interpreter fails to launch an NT process.
Ben Hillis (@benhillis) it's too late, Bitcrazed I think has confirmed that it will be a console improvement. Porting to bash will automatically come from your console redirection work muahahahahahaha
Activity
fpqc commentedon Oct 20, 2016
This is expected.
fpqc commentedon Oct 20, 2016
NextPrime (@nextprime) I think what would be ideal is if we could do something like "winsudo" that calls up a UAC prompt (in general for powershell stuff too).
benhillis commentedon Oct 20, 2016
The process exit code will be non-zero in this case indicating a failure. You're right, an error message would maybe be nice.
goreliu commentedon Oct 23, 2016
Run with
cmd.exe /C regedit.benhillis commentedon Oct 31, 2016
fpqc "winsudo" is an interesting idea but I feel like it is potentially a can of worms. I think if you need to run admin things from within bash you should just run bash.exe elevated.
I'm looking at adding some error text for when the binfmt interpreter fails to launch an NT process.
fpqc commentedon Oct 31, 2016
Ben Hillis (@benhillis) it's too late, Bitcrazed I think has confirmed that it will be a console improvement. Porting to bash will automatically come from your console redirection work muahahahahahaha
benhillis commentedon Oct 31, 2016
fpqc Do you have a reference to his comment?
fpqc commentedon Oct 31, 2016
Ben Hillis (@benhillis) It's on both uservoice and he told me on twitter.
https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/6513096-keep-command-line-history-add-sudo-command