Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One weird trick to get sudo on Windows 10... you'll never eat bananas again! #42

Closed
coolaj86 opened this issue Jul 12, 2020 · 3 comments

Comments

@coolaj86
Copy link
Member

Check this out!!

https://stackoverflow.com/a/40321310/151312

I definitely want to add that to webi.

@ryanburnette This brings up the issue that we do need a way to have non-mac/non-linux (meaning Windows 10 only) installer pages.

@coolaj86
Copy link
Member Author

coolaj86 commented Jul 13, 2020

Hmm... after reading further I'm not sure if that's actually a great solution due to issues with handling multiple arguments, spaces in PATH, etc. I'll have to try it out to know for sure.

Here's another idea:

The problem there being:

  • no https for downloads (can't use it in accordance with our security practices)
  • requires 7z (because 1337 h4x0rz...)

@coolaj86
Copy link
Member Author

Okay, I tried https://stackoverflow.com/a/55643173/151312, and it worked, although with a UAC prompt rather than a password prompt.

sudo.cmd:

@echo off
powershell -Command "Start-Process cmd -Verb RunAs -ArgumentList '/c cd /d %CD% && %*'"
@echo on

It also opens up a new cmd.exe window and this disappears.

Though... it seems to work.

sudo.cmd dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

@coolaj86
Copy link
Member Author

coolaj86 commented May 16, 2024

Pls delete as appropriate, or move to desired. Just wanted to say...
Indeed, it is the “…without opening a GUI to Alt-Click "Run as Administrator"…” is the reason a person would google-it for "Open elevated windows command prompt"

It's comical to me that there are actual tutorials for the task which demonstrate how to access the "Run-as admin". It's like, who cares? Do you really think I'd know what it means to use an "elevated" prompt, if I didn't realize basic O/S utilization

Anyway...
Thanks man!
This is awesome! I've not known of webi-installers prior to finding your thread on stackoverkill about the elevanted prompt/ powershell script

Are all of these (this repo) yours?
Looking forward to further investigation (the others) as time allows! oh, how i do waste the time playing with stuff like this! haha.
:)

Cheers and best regards!

@ajaxStardust

  1. You're welcome
  2. No, that comment doesn't belong in the Roadmap discussion. I can't move it, but if I could, I'd put it here (One weird trick to get sudo on Windows 10... you'll never eat bananas again! #42).
  3. I'm the core maintainer, but there have been many installer contributions from others
    (and these are primarily just installers - I didn't create most of the tools)

Re: #699 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant