3 ms·
Tangentially related, but I wish that running elevated from the shell was more ergonomic. I want to just be able to have a sudo-like command to run elevated fro
by ziml77 6y ago
Tangentially related, but I wish that running elevated from the shell was more ergonomic. I want to just be able to have a sudo-like command to run elevated from an otherwise non-elevated shell. Instead I have to launch a new instance of the shell host that's elevated. ConEmu makes this feel more seamless by doing some window manipulation hacks to bring elevated and non-elevated into tabs of the same window, but Windows Terminal doesn't want to do anything so hacky which means having a second Windows Terminal window when running elevated.
I wonder if improving this is possible within the current design of Windows or if it would be a fundamental change in how it handles user privileges.
- kingaillas 6y ago>I want to just be able to have a sudo-like command to run elevated from an otherwise non-elevated shell. Won't the runas command (https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc771525(v=ws.11) https://docs.microsoft.com/en-us/previous-versions/windows/i...) let you do this - run a command as Administrator without opening another command/powershell prompt?
- majkinetor 6y agocinst gsudo Works like on linux. Runas and friends are junk. https://github.com/gerardog/gsudo https://github.com/gerardog/gsudo
- ziml77 6y agoI'll have to check this one out. I vaguely remember coming across runas in the past and it not meeting my needs.
- jlgaddis 6y ago> ... a sudo-like command to run elevated from an otherwise non-elevated shell. Something like RunAs? [0] -- [0]: https://en.wikipedia.org/wiki/Runas https://en.wikipedia.org/wiki/Runas
- stjohnswarts 6y agoThat's what I was wondering? It's been around for literally decades. I'm 99.9% linux user now but back in the day runas came in handy on windows for daemons that I would write and test to run in the background as various users or admin.
- bruxis 6y agoIn addition to the alternatives others have mentioned, the author of `scoop` also has a package available for `scoop` named `sudo`, described as "An approximation of the Unix sudo command. Shows a UAC popup window unfortunately." From a non-elevated shell (cmd or ps), you can run `sudo <command>` to a roughly equivalent effect from *nix terminals. I find it meets my needs.