Add "Run As Administrator" menu option to Start Menu and Taskbar #6274

Open
opened 2026-01-31 00:34:24 +00:00 by claunia · 40 comments
Owner

Originally created by @wsmelton on GitHub (Feb 4, 2020).

Description of the new feature/enhancement

Ability, primarily in Windows, to easily open the terminal app in an elevated session. Either via the Start Menu icon, as the PowerShell app does it, or via the taskbar icon.

Example for Start Menu:
image

Example for Taskbar icon:
image

Originally created by @wsmelton on GitHub (Feb 4, 2020). # Description of the new feature/enhancement Ability, primarily in Windows, to easily open the terminal app in an elevated session. Either via the Start Menu icon, as the PowerShell app does it, or via the taskbar icon. Example for Start Menu: ![image](https://user-images.githubusercontent.com/11204251/73772649-2dce5080-4746-11ea-8193-c4d3e34ffb6c.png) Example for Taskbar icon: ![image](https://user-images.githubusercontent.com/11204251/73762287-9b25b580-4735-11ea-9868-6c525b884012.png)
claunia added the Issue-TaskProduct-TerminalArea-UserInterface labels 2026-01-31 00:34:25 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 4, 2020):

Your start menu screenshot is a screenshot of our issue template 😄

@DHowett-MSFT commented on GitHub (Feb 4, 2020): Your start menu screenshot is a screenshot of our issue template 😄
Author
Owner

@abvgdeyoj commented on GitHub (Feb 9, 2020):

Afaik this is already possible. (Russian locale - don't panic)
1
2
3

@abvgdeyoj commented on GitHub (Feb 9, 2020): Afaik this is already possible. (Russian locale - don't panic) ![1](https://user-images.githubusercontent.com/1658871/74110234-0edb1e80-4b8b-11ea-84cb-1be2e9994844.png) ![2](https://user-images.githubusercontent.com/1658871/74110235-0f73b500-4b8b-11ea-9821-f504e7d0c834.png) ![3](https://user-images.githubusercontent.com/1658871/74110236-0f73b500-4b8b-11ea-8c87-52ee9228e996.png)
Author
Owner

@wsmelton commented on GitHub (Feb 10, 2020):

My point is to make it more accessible, not that it is not possible.

Having to right click twice from the taskbar icon when it is a command need is inefficient.

@wsmelton commented on GitHub (Feb 10, 2020): My point is to make it more accessible, not that it is not possible. Having to right click twice from the taskbar icon when it is a command need is inefficient.
Author
Owner

@abvgdeyoj commented on GitHub (Feb 10, 2020):

Now, Windows Terminal is not:

  1. An app you have to launch often because of TDI
  2. An app you can't make a "Run as Administrator" shortcut for. (Not directly, but "C:\Windows\system32\cmd.exe /c start /b wt" works)
  3. An app for which the aforementioned shortcut could not be placed in the "Startup" folder, Desktop, Taskbar, key binding, etc...

I don't feel it's that much needed to duplicate an existing feature in such a unsystematic and aesthetically frustrating manner.

I know that we are talking about a product intended mainly for Windows, in which POLP is often neglected, but I do want to bring up that running something by default with elevated privileges is considered to be a bad practice.

@abvgdeyoj commented on GitHub (Feb 10, 2020): Now, Windows Terminal is not: 1. An app you have to launch often because of [TDI](https://en.wikipedia.org/wiki/Tab_(interface)) 2. An app you can't make a "Run as Administrator" shortcut for. (Not directly, but ["C:\Windows\system32\cmd.exe /c start /b wt"](http://nuts4.net/post/windows-terminal-run-as-admin) works) 3. An app for which the aforementioned shortcut could not be placed in the "Startup" folder, Desktop, Taskbar, key binding, etc... I don't feel it's that much needed to duplicate an existing feature in such a unsystematic and aesthetically frustrating manner. I know that we are talking about a product intended mainly for Windows, in which [POLP](https://en.wikipedia.org/wiki/Principle_of_least_privilege) is often neglected, but I do want to bring up that running something by default with elevated privileges is considered to be a [bad practice](https://superuser.com/questions/500119/keeping-the-fancy-sudo-warning-forever).
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 10, 2020):

This'll also require us to look at the newWindow key binding and the jump list (#576). I was going to close this and link it to #1032, but it's distinct and tractable enough to stand on its own. Thanks.

@DHowett-MSFT commented on GitHub (Feb 10, 2020): This'll also require us to look at the `newWindow` key binding and the jump list (#576). I was going to close this and link it to #1032, but it's distinct and tractable enough to stand on its own. Thanks.
Author
Owner

@jbpaux commented on GitHub (Feb 15, 2020):

Yes please ! Implement it like in pwsh with JumpList tasks : db370dcc79/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList

@jbpaux commented on GitHub (Feb 15, 2020): Yes please ! Implement it like in pwsh with JumpList tasks : https://github.com/PowerShell/PowerShell/tree/db370dcc794e2f7b3c93e00b4538f1485d937f13/src/Microsoft.PowerShell.ConsoleHost/WindowsTaskbarJumpList
Author
Owner

@erenken commented on GitHub (Feb 15, 2020):

I would actually love to see the Run As Administrator also in the drop-down in the Terminal application where you select which terminal you want. This would make quick access and then I would only do it when I really needed to. I know it would need to start up a new process, but have that process start in the terminal mode I selected and elevated would be awesome.

@erenken commented on GitHub (Feb 15, 2020): I would actually love to see the Run As Administrator also in the drop-down in the Terminal application where you select which terminal you want. This would make quick access and then I would only do it when I really needed to. I know it would need to start up a new process, but have that process start in the terminal mode I selected and elevated would be awesome.
Author
Owner

@cstueckrath commented on GitHub (Feb 18, 2020):

I see more issues with the whole app concept.
I am not a local administrator on my machine, so I elevate with another user.
The problem is, that the application is unknown in the context of this user, and because you cannot run the Store as admin or another user, you have to log with every single user you need to run Terminal as and install/update from store...

@cstueckrath commented on GitHub (Feb 18, 2020): I see more issues with the whole app concept. I am not a local administrator on my machine, so I elevate with another user. The problem is, that the application is unknown in the context of this user, and because you cannot run the Store as admin or another user, you have to log with every single user you need to run Terminal as and install/update from store...
Author
Owner

@wsmelton commented on GitHub (Feb 18, 2020):

@cstueckrath that would be how apps work from the Windows Store, everyone of them work in that manner (few exceptions, but not many).

Option would be to just grab the msix file from the release page of this repository and try to install it under the context of just that user.

@wsmelton commented on GitHub (Feb 18, 2020): @cstueckrath that would be how apps work from the Windows Store, everyone of them work in that manner (few exceptions, but not many). Option would be to just grab the msix file from the release page of this repository and try to install it under the context of just that user.
Author
Owner

@cstueckrath commented on GitHub (Feb 20, 2020):

@wsmelton I know, and I don't mind running calculator or paint as "Apps", but for management tools? They should be available and updateable system wide.
Maybe I don't get the concept of all this, but neither of those Store-tools will be usable in my environment - and we don't even talk about those people using Win10 LTSB...

@cstueckrath commented on GitHub (Feb 20, 2020): @wsmelton I know, and I don't mind running calculator or paint as "Apps", but for management tools? They should be available and updateable system wide. Maybe I don't get the concept of all this, but neither of those Store-tools will be usable in my environment - and we don't even talk about those people using Win10 LTSB...
Author
Owner

@swinster commented on GitHub (Feb 20, 2020):

FWIW, I have literally just installed Terminal, it took me around 10-15 seconds to ask myself "how to I run a terminal as an administrator". I clicked feedback, then search open issues for "administrator" and came here....

@swinster commented on GitHub (Feb 20, 2020): FWIW, I have literally just installed Terminal, it took me around 10-15 seconds to ask myself "how to I run a terminal as an administrator". I clicked feedback, then search open issues for "administrator" and came here....
Author
Owner

@abvgdeyoj commented on GitHub (Feb 20, 2020):

@cstueckrath The entire "Apps" concept still has a long way to ever get to the point where Windows is a modular system consisting of "Apps", but seeing the developers attitude under Nadella, chances are that Windows will crack open its sources like NetScape back in the days, and Azure (or Outlook, or Xbox Game Pass) will be his main business long before that might happen.
As for the LTSB, Microsoft Store is not needed for .appx or .msix to be installed

@abvgdeyoj commented on GitHub (Feb 20, 2020): @cstueckrath The entire "Apps" concept still has a long way to ever get to the point where Windows is a modular system consisting of "Apps", but seeing the developers attitude under Nadella, chances are that Windows will crack open its sources like NetScape back in the days, and Azure (or Outlook, or Xbox Game Pass) will be his main business long before that might happen. As for the LTSB, Microsoft Store is not needed for .appx or .msix to be installed
Author
Owner

@dpokluda commented on GitHub (Feb 25, 2020):

I would like to add Windows Terminal to Start menu and Taskbar so that when I click it, it will start elevated. How do I do that (without right-clicking)?

@dpokluda commented on GitHub (Feb 25, 2020): I would like to add Windows Terminal to Start menu and Taskbar so that when I click it, it will start elevated. How do I do that (without right-clicking)?
Author
Owner

@igor-teresco commented on GitHub (Feb 26, 2020):

Create a shortcut to "C:\Windows\system32\cmd.exe /c start /b wt", set it to be Run As administrator from properties.

@igor-teresco commented on GitHub (Feb 26, 2020): Create a shortcut to "C:\Windows\system32\cmd.exe /c start /b wt", set it to be Run As administrator from properties.
Author
Owner

@garyng2000 commented on GitHub (Mar 10, 2020):

yes, but instead of menu option, can't we have the simple 'sudo bash' equivalent ? we are talking about console/command line here :-)

@garyng2000 commented on GitHub (Mar 10, 2020): yes, but instead of menu option, can't we have the simple 'sudo bash' equivalent ? we are talking about console/command line here :-)
Author
Owner

@zadjii-msft commented on GitHub (Mar 10, 2020):

@garyng2000 Unfortunately, it's not that simple. You may be interested in https://github.com/microsoft/terminal/issues/1032#issuecomment-496308808

@zadjii-msft commented on GitHub (Mar 10, 2020): @garyng2000 Unfortunately, it's not that simple. You may be interested in https://github.com/microsoft/terminal/issues/1032#issuecomment-496308808
Author
Owner

@garyng2000 commented on GitHub (Mar 10, 2020):

I don't quite understand the #1032 issue, I assume you meant security.

What would be the difference between 'sudo bash' vs 'right click' then run as Admin on the start menu ?

I don't really need to have the 'current terminal' session to be the parent of the 'elevated shell', but just give me a completely unrelated shell is fine. The usage scenario is just 'I am already in the directory I am in and need elevation for certain tasks'. VS Code can do this too when I try to save files under '\Windows' so why the 'terminal' app cannot ?

Though not a big issue as I already have the habit of just having a few 'admin' shell opened via the 'right click' route.

@garyng2000 commented on GitHub (Mar 10, 2020): I don't quite understand the #1032 issue, I assume you meant security. What would be the difference between 'sudo bash' vs 'right click' then run as Admin on the start menu ? I don't really need to have the 'current terminal' session to be the parent of the 'elevated shell', but just give me a completely unrelated shell is fine. The usage scenario is just 'I am already in the directory I am in and need elevation for certain tasks'. VS Code can do this too when I try to save files under '\Windows' so why the 'terminal' app cannot ? Though not a big issue as I already have the habit of just having a few 'admin' shell opened via the 'right click' route.
Author
Owner

@zadjii-msft commented on GitHub (Mar 10, 2020):

For sudo bash, bash is fundamentally still running in an unelevated window, so other unelevated applications can send keystrokes to bash by sending keystrokes to the unelevated terminal window.

When you right-click "run as admin" launch a process, it spawns a new terminal window, and that window is elevated, so it's protected from input being injected by other applications.

This is the fundamental reason there isn't a builtin in-console elevation exe like sudo on Windows.

I believe that Start-Process -Verb RunAs cmd (in powershell) will actually create a new elevated console window to run the elevated process, which sounds a lot like what you're looking for.

@zadjii-msft commented on GitHub (Mar 10, 2020): For `sudo bash`, bash is fundamentally still running in an unelevated window, so other unelevated applications can send keystrokes to bash by sending keystrokes to the unelevated terminal window. When you right-click "run as admin" launch a process, it spawns a _new_ terminal window, and that window is elevated, so it's protected from input being injected by other applications. This is the fundamental reason there isn't a builtin in-console elevation exe like `sudo` on Windows. I _believe_ that `Start-Process -Verb RunAs cmd` (in powershell) will actually create a new _elevated_ console window to run the elevated process, which sounds a lot like what you're looking for.
Author
Owner

@garyng2000 commented on GitHub (Mar 10, 2020):

yes, but that is a lot of typing vs 'sudo bash'(and I have to include the working directory as well which becomes even longer) :-)

I would say 90% of the usage of 'sudo bash' is what I am doing(well may be there are some exotic way in the linux world utilizing what you mentioned but I have no experience of that personally).

@garyng2000 commented on GitHub (Mar 10, 2020): yes, but that is a lot of typing vs 'sudo bash'(and I have to include the working directory as well which becomes even longer) :-) I would say 90% of the usage of 'sudo bash' is what I am doing(well may be there are some exotic way in the linux world utilizing what you mentioned but I have no experience of that personally).
Author
Owner

@3col commented on GitHub (Mar 11, 2020):

I've been using these context menu shortcuts:
(https://www.tenforums.com/tutorials/60132-open-bash-window-here-administrator-add-windows-10-a.html)](https://www.tenforums.com/tutorials/60132-open-bash-window-here-administrator-add-windows-10-a.html)
to be able to quick and easy open "Open command/bash window here as administrator".

Did few modifications, but some less cryptic way would be nice too:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenTerminalHereAsAdmin]
@="Open Terminal here as administrator"
"Extended"=-

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenTerminalHereAsAdmin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\""

[HKEY_CLASSES_ROOT\Directory\shell\OpenTerminalHereAsAdmin]
@="Open Terminal here as administrator"
"Extended"=-

[HKEY_CLASSES_ROOT\Directory\shell\OpenTerminalHereAsAdmin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\""

[HKEY_CLASSES_ROOT\Drive\shell\OpenTerminalHereAsAdmin]
@="Open Terminal here as administrator"
"Extended"=-

[HKEY_CLASSES_ROOT\Drive\shell\OpenTerminalHereAsAdmin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\""

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenTerminalHereAsAdmin]
@="Open Terminal here as administrator"
"Extended"=-

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenTerminalHereAsAdmin\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\""



@3col commented on GitHub (Mar 11, 2020): I've been using these context menu shortcuts: (https://www.tenforums.com/tutorials/60132-open-bash-window-here-administrator-add-windows-10-a.html)](https://www.tenforums.com/tutorials/60132-open-bash-window-here-administrator-add-windows-10-a.html) to be able to quick and easy open "Open command/bash window here as administrator". Did few modifications, but some less cryptic way would be nice too: ``` Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenTerminalHereAsAdmin] @="Open Terminal here as administrator" "Extended"=- [HKEY_CLASSES_ROOT\Directory\Background\shell\OpenTerminalHereAsAdmin\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\"" [HKEY_CLASSES_ROOT\Directory\shell\OpenTerminalHereAsAdmin] @="Open Terminal here as administrator" "Extended"=- [HKEY_CLASSES_ROOT\Directory\shell\OpenTerminalHereAsAdmin\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\"" [HKEY_CLASSES_ROOT\Drive\shell\OpenTerminalHereAsAdmin] @="Open Terminal here as administrator" "Extended"=- [HKEY_CLASSES_ROOT\Drive\shell\OpenTerminalHereAsAdmin\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\"" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenTerminalHereAsAdmin] @="Open Terminal here as administrator" "Extended"=- [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenTerminalHereAsAdmin\command] @="PowerShell -windowstyle hidden -Command \"Start-Process cmd -Verb RunAs -ArgumentList '/c start wt -p cmd -d \"\"%V\\.\"\"'\"" ```
Author
Owner

@dflor003 commented on GitHub (Mar 11, 2020):

I spent about 5 minutes right clicking on the pinned icon I had for the terminal in my taskbar trying to figure out why I couldn't see "Properties" in there and use that to set it to always run as admin...

Every other application I've ever used on windows lets me set it to run as an administrator automatically using that.

Eventually I figured it was because it was a windows store app which for some reason gives it a completely different menu than everything else, but that really clashes with my expectations as a user.

Putting this automatic "Run as Administrator" feature would at least let us get parity with the functionality we as users are used to.

@dflor003 commented on GitHub (Mar 11, 2020): I spent about 5 minutes right clicking on the pinned icon I had for the terminal in my taskbar trying to figure out why I couldn't see "Properties" in there and use that to set it to always run as admin... Every other application I've ever used on windows lets me set it to run as an administrator automatically using that. Eventually I figured it was because it was a windows store app which for some reason gives it a completely different menu than everything else, but that really clashes with my expectations as a user. Putting this automatic "Run as Administrator" feature would at least let us get parity with the functionality we as users are used to.
Author
Owner

@garyng2000 commented on GitHub (Mar 12, 2020):

you just need to do it differently for this. right click then right click on the 'app title' again and you see the menu. weird but that is how it works. true store app like the 'store' itself just can't do this 'run as admin'

@garyng2000 commented on GitHub (Mar 12, 2020): you just need to do it differently for this. right click then right click on the 'app title' again and you see the menu. weird but that is how it works. true store app like the 'store' itself just can't do this 'run as admin'
Author
Owner

@dflor003 commented on GitHub (Mar 12, 2020):

you just need to do it differently for this. right click then right click on the 'app title' again and you see the menu. weird but that is how it works. true store app like the 'store' itself just can't do this 'run as admin'

I see the menu, but there's no "Properties" in there that I can set it to always run as administrator.

@dflor003 commented on GitHub (Mar 12, 2020): > you just need to do it differently for this. right click then right click on the 'app title' again and you see the menu. weird but that is how it works. true store app like the 'store' itself just can't do this 'run as admin' I see the menu, but there's no "Properties" in there that I can set it to always run as administrator.
Author
Owner

@garyng2000 commented on GitHub (Mar 12, 2020):

ah, that is not possible AFAIK for security reason. The WindowsApp is locked down, not even admin can access it so all these tricks of changing property would not work.

@garyng2000 commented on GitHub (Mar 12, 2020): ah, that is not possible AFAIK for security reason. The WindowsApp is locked down, not even admin can access it so all these tricks of changing property would not work.
Author
Owner

@Elepover commented on GitHub (Apr 3, 2020):

Just found this blog post.

Credit: Daniel-Fisher-(lennybacon)

This is a dirty approach (but man ANYWAY IT WORKS): patching lnk file to force "tick" the "Run as Administrator" checkbox.

  • Drag and drop Windows Terminal shortcut to desktop
  • Hold shift key and right-click desktop
  • Choose "Open PowerShell Window Here"
  • And paste below snippet:
$linkFilePath = "C:\Users\$([Environment]::UserName)\Desktop\WindowsTerminal.lnk"
$bytes = [System.IO.File]::ReadAllBytes($linkFilePath)
$bytes[0x15] = $bytes[0x15] -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON
[System.IO.File]::WriteAllBytes($linkFilePath, $bytes)

Though this is not considered as a clean & elegant approach, it still works perfectly.

@Elepover commented on GitHub (Apr 3, 2020): Just found [this blog post](https://lennybacon.com/post/Create-a-link-to-a-UWP-app-to-run-as-administrator). Credit: `Daniel-Fisher-(lennybacon)` This is a dirty approach (but man **ANYWAY IT WORKS**): patching `lnk` file to force "tick" the "Run as Administrator" checkbox. - Drag and drop Windows Terminal shortcut to desktop - Hold shift key and right-click desktop - Choose "Open PowerShell Window Here" - And paste below snippet: ```powershell $linkFilePath = "C:\Users\$([Environment]::UserName)\Desktop\WindowsTerminal.lnk" $bytes = [System.IO.File]::ReadAllBytes($linkFilePath) $bytes[0x15] = $bytes[0x15] -bor 0x20 #set byte 21 (0x15) bit 6 (0x20) ON [System.IO.File]::WriteAllBytes($linkFilePath, $bytes) ``` Though this is not considered as a clean & elegant approach, it still works perfectly.
Author
Owner

@schuelermine commented on GitHub (Apr 27, 2020):

About this being a duplicate of existing features: No. In the task bar, for instance, you can't select "Run as Administrator". This is btw also what PowerShell does...

@schuelermine commented on GitHub (Apr 27, 2020): ~~About this being a duplicate of existing features: No. In the task bar, for instance, you can't select "Run as Administrator". This is btw also what PowerShell does...~~
Author
Owner

@Melvin-Abraham commented on GitHub (May 29, 2020):

Having an option like "Run as admin" within the context menu for a tab/pane would also be more accessible and let users give a particular tab/pane elevated privileges on demand.

@Melvin-Abraham commented on GitHub (May 29, 2020): Having an option like "Run as admin" within the context menu for a tab/pane would also be more accessible and let users give a particular tab/pane elevated privileges on demand.
Author
Owner

@schuelermine commented on GitHub (May 29, 2020):

I think having a quick action available directly when right-clicking the taskbar icon is easier than right-clicking once, then right-clicking again on the executable.

@schuelermine commented on GitHub (May 29, 2020): I think having a quick action available directly when right-clicking the taskbar icon is easier than right-clicking once, then right-clicking again on the executable.
Author
Owner

@spixy commented on GitHub (Jun 9, 2020):

Having admin privileges for whole terminal seems wrong to me.
Right click submenu would be nice though:

image

or add this option in settings.json:

{
   ...
   "commandline": "cmd.exe",
   "elevated": true
}
@spixy commented on GitHub (Jun 9, 2020): Having admin privileges for whole terminal seems wrong to me. Right click submenu would be nice though: ![image](https://user-images.githubusercontent.com/4542110/84176990-83af5e00-aa82-11ea-9a4a-f9a2eb514f8d.png) or add this option in `settings.json`: ```js { ... "commandline": "cmd.exe", "elevated": true } ```
Author
Owner

@wsmelton commented on GitHub (Jun 9, 2020):

The restriction I see in doing that @spixy (at least from my limited understanding and dealing with other apps in Windows) is Windows won't allow you to spawn a child process as elevated while your are in a non-elevated process (wsl). I hit this at times with various applications now.

@wsmelton commented on GitHub (Jun 9, 2020): The restriction I see in doing that @spixy (_at least from my limited understanding and dealing with other apps in Windows_) is Windows won't allow you to spawn a child process as elevated while your are in a non-elevated process (wsl). I hit this at times with various applications now.
Author
Owner

@abvgdeyoj commented on GitHub (Jun 9, 2020):

Without major changes to how WT works, one way would be to implement it the same as we have in many SysInternals, and that is to add an option to restart the entire process elevated.
png
It 's not the best solution, but it works for me and should solve most of comments regarding "Run as Admin" being hard to find.

@abvgdeyoj commented on GitHub (Jun 9, 2020): Without major changes to how WT works, one way would be to implement it the same as we have in many SysInternals, and that is to add an option to restart the entire process elevated. ![png](https://user-images.githubusercontent.com/1658871/84200192-9b98d900-aaa6-11ea-8246-264fe167b52a.png) It 's not the best solution, but it works for me and should solve most of comments regarding "Run as Admin" being hard to find.
Author
Owner

@spixy commented on GitHub (Jun 9, 2020):

@wsmelton interesting, but ConEmu can do it somehow 🤔
image
image
(orange = elevated process)

@spixy commented on GitHub (Jun 9, 2020): @wsmelton interesting, but ConEmu can do it somehow 🤔 ![image](https://user-images.githubusercontent.com/4542110/84208264-9beba100-aab3-11ea-9912-deff9eeb3bf4.png) ![image](https://user-images.githubusercontent.com/4542110/84208368-e3722d00-aab3-11ea-8f69-da31c61031b0.png) (orange = elevated process)
Author
Owner

@DHowett commented on GitHub (Jun 9, 2020):

These past few comments are better suited for #632, where we're having an ongoing discussion about why it's okay for third party developers to do this but not us (right now). Please direct further discussion that is not about adding "Run as Administrator" to the Start Menu and Taskbar to #632.

@DHowett commented on GitHub (Jun 9, 2020): These past few comments are better suited for #632, where we're having an ongoing discussion about why it's okay for _third party developers_ to do this but not us (right now). Please direct further discussion that is not about adding "Run as Administrator" to the Start Menu and Taskbar to #632.
Author
Owner

@tssva commented on GitHub (Jun 12, 2020):

Until this gets implemented those that are double right clicking to run as administrator may instead want to perform a shift-right-click which will bring you directly to a menu with the "Run as administrator" option.

@tssva commented on GitHub (Jun 12, 2020): Until this gets implemented those that are double right clicking to run as administrator may instead want to perform a shift-right-click which will bring you directly to a menu with the "Run as administrator" option.
Author
Owner

@jbpaux commented on GitHub (Jun 12, 2020):

Until this gets implemented those that are double right clicking to run as administrator may instead want to perform a shift-right-click which will bring you directly to a menu with the "Run as administrator" option.

Or just ctrl shit left click to open directly as admin ;)

@jbpaux commented on GitHub (Jun 12, 2020): > > > Until this gets implemented those that are double right clicking to run as administrator may instead want to perform a shift-right-click which will bring you directly to a menu with the "Run as administrator" option. Or just ctrl shit left click to open directly as admin ;)
Author
Owner

@ghost commented on GitHub (Jul 2, 2020):

For sudo bash, bash is fundamentally still running in an unelevated window, so other unelevated applications can send keystrokes to bash by sending keystrokes to the unelevated terminal window.

When you right-click "run as admin" launch a process, it spawns a new terminal window, and that window is elevated, so it's protected from input being injected by other applications.

This is the fundamental reason there isn't a builtin in-console elevation exe like sudo on Windows.

I believe that Start-Process -Verb RunAs cmd (in powershell) will actually create a new elevated console window to run the elevated process, which sounds a lot like what you're looking for.

@zadjii-msft why not a command like sudo bash which open the whole windows terminal in a new window with elevated mode and closes the previous terminal window, that way the un-elevated window will be closed and the new window will be in the elevated mode . Let's say i open the terminal using wt -d . so that it opens in the current directory, but wt opens in non-elevated mode. So if there was an option to enter elevated mode in the current directory, that would be very useful.

@ghost commented on GitHub (Jul 2, 2020): > > > For `sudo bash`, bash is fundamentally still running in an unelevated window, so other unelevated applications can send keystrokes to bash by sending keystrokes to the unelevated terminal window. > > When you right-click "run as admin" launch a process, it spawns a _new_ terminal window, and that window is elevated, so it's protected from input being injected by other applications. > > This is the fundamental reason there isn't a builtin in-console elevation exe like `sudo` on Windows. > > I _believe_ that `Start-Process -Verb RunAs cmd` (in powershell) will actually create a new _elevated_ console window to run the elevated process, which sounds a lot like what you're looking for. @zadjii-msft why not a command like `sudo bash` which open the whole windows terminal in a new window with elevated mode and closes the previous terminal window, that way the un-elevated window will be closed and the new window will be in the elevated mode . Let's say i open the terminal using `wt -d .` so that it opens in the current directory, but wt opens in non-elevated mode. So if there was an option to enter elevated mode in the current directory, that would be very useful.
Author
Owner

@webluke commented on GitHub (Apr 7, 2021):

Run as Administrator should have been part of the first release. Now that it hasn't I hope they get it right and make it as easy as right-clicking on a profile and selecting "Run as Administrator". It must be a profile > list option in the json config.

Something like this..
"administrator": true

@webluke commented on GitHub (Apr 7, 2021): Run as Administrator should have been part of the first release. Now that it hasn't I hope they get it right and make it as easy as right-clicking on a profile and selecting "Run as Administrator". It must be a profile > list option in the json config. Something like this.. `"administrator": true`
Author
Owner

@zadjii-msft commented on GitHub (Apr 7, 2021):

@webluke Boy, would you be interested in #8455, #8514, #5000 and all its linked threads.

@zadjii-msft commented on GitHub (Apr 7, 2021): @webluke Boy, would you be interested in #8455, #8514, #5000 and all its linked threads.
Author
Owner

@zadjii-msft commented on GitHub (Jul 25, 2022):

FWIW This will probably need #12191 to add --elevate to the wt commandline args, and then it should be fairly trivial to add a jumplist entry that points at wt --elevate.

@zadjii-msft commented on GitHub (Jul 25, 2022): FWIW This will probably need #12191 to add `--elevate` to the `wt` commandline args, and then it should be fairly trivial to add a jumplist entry that points at `wt --elevate`.
Author
Owner

@dm17ryk commented on GitHub (Nov 3, 2024):

As I understand, we do have:

Right click on terminal icon on taskbar (1) ⇒ right click on terminal menu terminal itself icon (2) ⇒ we have "Run As Administrator" option:

Image

Nice to have:

Right click on terminal icon on taskbar (1) ⇒ right click on terminal menu, any profile icon (2) ⇒ we have only "Open" option, but want to have also "Run As Administrator" option:

Image

I want to implement it.


And actually we do have option to run as admin any profile from profiles menu, open profiles "drop down" and right click on any profile:

Image

@dm17ryk commented on GitHub (Nov 3, 2024): ## As I understand, we do have: ### Right click on terminal icon on taskbar (1) ⇒ right click on terminal menu terminal itself icon (2) ⇒ we have "Run As Administrator" option: ![Image](https://github.com/user-attachments/assets/a2e0ddb4-448f-44c7-85bb-5d9b1b8706b2) ## Nice to have: ### Right click on terminal icon on taskbar (1) ⇒ right click on terminal menu, any profile icon (2) ⇒ we have only "Open" option, but want to have also "Run As Administrator" option: ![Image](https://github.com/user-attachments/assets/020913bf-3741-4624-8a55-5dd1a78065b7) ## I want to implement it. ___________________________ ### And actually we do have option to run as admin any profile from profiles menu, open profiles "drop down" and right click on any profile: ![Image](https://github.com/user-attachments/assets/c1488186-6832-41fd-b3a4-0518a1326094)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6274