Add Run as Administrator to Jump List context menu #10739

Closed
opened 2026-01-31 02:28:58 +00:00 by claunia · 15 comments
Owner

Originally created by @tlmii on GitHub (Sep 23, 2020).

Description of the new feature/enhancement

Showing the profiles on the jump list is a great addition. The one thing missing for my workflow is to be able to run the profile as an administrator. I run Terminal as non-admin most of the time (and don't need the jump list for that). But my case for picking a specific profile from the jump list - for a new window - is almost always because I need that one specific profile run as admin.

Proposed technical implementation details (optional)

Not very technical, but what I'd like to see: Add "Run as Administrator" to the context menu of each profile in the jump list, where currently "Open" is the only option.

Originally created by @tlmii on GitHub (Sep 23, 2020). # Description of the new feature/enhancement Showing the profiles on the jump list is a great addition. The one thing missing for my workflow is to be able to run the profile as an administrator. I run Terminal as non-admin most of the time (and don't need the jump list for that). But my case for picking a specific profile from the jump list - for a new window - is almost always because I need that one specific profile run as admin. # Proposed technical implementation details (optional) Not very technical, but what I'd like to see: Add "Run as Administrator" to the context menu of each profile in the jump list, where currently "Open" is the only option.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 24, 2020):

The documentation of destinations in a jump list mentions: "Each item in a destination list can be right-clicked for its own shortcut menu." Indeed, in the jump list of File Explorer, each folder in the "Frequent" category has a context menu that includes commands like "Open in Visual Studio", "Open in Windows Terminal", and "Git Bash Here".

The jump list of Windows Terminal however contains tasks rather than destinations. There is a rationale for that in the Add Profiles To Jumplist spec. I don't know whether Windows supports custom commands in context menus for tasks in a jump list.

@KalleOlaviNiemitalo commented on GitHub (Sep 24, 2020): The documentation of [destinations in a jump list](https://docs.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#destinations) mentions: "Each item in a destination list can be right-clicked for its own shortcut menu." Indeed, in the jump list of File Explorer, each folder in the "Frequent" category has a context menu that includes commands like "Open in Visual Studio", "Open in Windows Terminal", and "Git Bash Here". The jump list of Windows Terminal however contains tasks rather than destinations. There is a rationale for that in the [_Add Profiles To Jumplist_ spec](https://github.com/microsoft/terminal/blob/825039ea177b9f83a2ad05d3a8238df78b98055f/doc/specs/drafts/576-ProfilesJumplistSpec.md#adding-profiles-to-the-jumplist). I don't know whether Windows supports custom commands in context menus for tasks in a jump list.
Author
Owner

@tlmii commented on GitHub (Sep 24, 2020):

Yeah, now that you mention it, I don't see any context menu options on any of my other apps on the task bar for items on their Tasks list. So it may not be possible. I hope there's a way around, because in this case it seems to make a lot of sense!

@tlmii commented on GitHub (Sep 24, 2020): Yeah, now that you mention it, I don't see any context menu options on any of my other apps on the task bar for items on their Tasks list. So it may not be possible. I hope there's a way around, because in this case it seems to make a lot of sense!
Author
Owner

@DHowett commented on GitHub (Sep 25, 2020):

The best we'll plan to do for now is actually just gonna be to add a "Run as Administrator" (which launches to the default profile, not to any specific profile) task to the top of the list.

@DHowett commented on GitHub (Sep 25, 2020): The best we'll plan to do for now is actually just gonna be to add a "Run as Administrator" (which launches to the default profile, not to any specific profile) task to the top of the list.
Author
Owner

@WSLUser commented on GitHub (Sep 25, 2020):

So it's actually at the bottom of the list currently. So users can still run as Administrator with the default profile. I do wish the jump list did have a run as option per profile but that could understandably be a post 2.0 thing.

@WSLUser commented on GitHub (Sep 25, 2020): So it's actually at the bottom of the list currently. So users can still run as Administrator with the default profile. I do wish the jump list did have a run as option per profile but that could understandably be a post 2.0 thing.
Author
Owner

@amithegde commented on GitHub (Nov 25, 2020):

We need this, it takes more effort to open terminal every time😒
I also wish quick launch icons had properties to make it start with admin privileges. I know, I know, windbg doesn't support it but Sysinternals Proc Explorer supports it and it saves me few steps👌

@amithegde commented on GitHub (Nov 25, 2020): We need this, it takes more effort to open terminal every time😒 I also wish quick launch icons had properties to make it start with admin privileges. I know, I know, windbg doesn't support it but Sysinternals Proc Explorer supports it and it saves me few steps👌
Author
Owner

@IBIT-ZEE commented on GitHub (May 4, 2021):

I think the most useful way would be:
right click the tab and have an option in the context menu
for re-launching as administrator (re-use the same tab)
or launch a new tab with the same command-line but as administrator...

@IBIT-ZEE commented on GitHub (May 4, 2021): I think the most useful way would be: right click the tab and have an option in the context menu for re-launching as administrator (re-use the same tab) or launch a new tab with the same command-line but as administrator...
Author
Owner

@akrantz commented on GitHub (Oct 13, 2021):

Is there a way I can make a pinned taskbar shortcut which ALWAYS runs as Administrator. I'd like this separately from having it pinned where it doesn't run as admin. I want to use this as a build window which needs to be elevated by default. I can right-click the pinned taskbar icon, and then right-click on "Windows Terminal" to get a "Run as Administrator" option -- which is what I do, but what I really want is an easy way to have a pinned item which opens elevated for a specific item.

I can sort of do this by running cmd /c wt.exe -o <profile> and there might be a way to make a shortcut for that, but it would be nice if there was a more direct way to achieve this.

@akrantz commented on GitHub (Oct 13, 2021): Is there a way I can make a pinned taskbar shortcut which ALWAYS runs as Administrator. I'd like this separately from having it pinned where it doesn't run as admin. I want to use this as a build window which needs to be elevated by default. I can right-click the pinned taskbar icon, and then right-click on "Windows Terminal" to get a "Run as Administrator" option -- which is what I do, but what I really want is an easy way to have a pinned item which opens elevated for a specific item. I can sort of do this by running `cmd /c wt.exe -o <profile>` and there might be a way to make a shortcut for that, but it would be nice if there was a more direct way to achieve this.
Author
Owner

@zadjii-msft commented on GitHub (Oct 13, 2021):

@akrantz when #632 lands (hopefully 1.13), you should be able to mark a profile as always elevated, and you could just click that in the jumplist to open an elevated window with that profile. If you want that as a separate taskbar icon, then yea, wt -p <your elevated profile> would be the commandline to use in your shortcut (again, once #632 lands).

@zadjii-msft commented on GitHub (Oct 13, 2021): @akrantz when #632 lands (hopefully 1.13), you should be able to mark a profile as always elevated, and you could just click that in the jumplist to open an elevated window with that profile. If you want that as a separate taskbar icon, then yea, `wt -p <your elevated profile>` would be the commandline to use in your shortcut (again, once #632 lands).
Author
Owner

@akrantz commented on GitHub (Oct 13, 2021):

@zadjii-msft Thanks! I wasn't sure from the various issues whether this was being addressed already, and I'm glad that it is.

@akrantz commented on GitHub (Oct 13, 2021): @zadjii-msft Thanks! I wasn't sure from the various issues whether this was being addressed already, and I'm glad that it is.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (May 30, 2022):

If the task bar does not support custom menus for tasks in a jump list, can Ctrl+click or Ctrl+Shift+click on the jump list item be made to start the profile as elevated? Terminal creates an IShellLink with a wt.exe command, and I imagine the task bar itself could recognize Ctrl+Shift+click and run that command as elevated, but on Windows 10 version 21H2, it doesn't.

ICustomDestinationList::AddUserTasks allows IShellLink and IShellItem, and Terminal creates an IShellLink with a wt.exe command. If the link could instead point to a CLSID, then perhaps that class could implement some interface and receive a flag like CMIC_MASK_CONTROL_DOWN.

@KalleOlaviNiemitalo commented on GitHub (May 30, 2022): If the task bar does not support custom menus for tasks in a jump list, can Ctrl+click or Ctrl+Shift+click on the jump list item be made to start the profile as elevated? [Terminal creates an IShellLink with a `wt.exe` command](https://github.com/microsoft/terminal/blob/11b810e4036b669e5f223cce447f76d56044be0f/src/cascadia/TerminalApp/Jumplist.cpp#L125-L133), and I imagine the task bar itself could recognize Ctrl+Shift+click and run that command as elevated, but on Windows 10 version 21H2, it doesn't. [ICustomDestinationList::AddUserTasks](https://docs.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-addusertasks) allows [IShellLink](https://docs.microsoft.com/windows/win32/api/shobjidl_core/nn-shobjidl_core-ishelllinkw) and [IShellItem](https://docs.microsoft.com/windows/win32/api/shobjidl_core/nn-shobjidl_core-ishellitem), and [Terminal creates an IShellLink with a `wt.exe` command](https://github.com/microsoft/terminal/blob/11b810e4036b669e5f223cce447f76d56044be0f/src/cascadia/TerminalApp/Jumplist.cpp#L125-L133). If the link could instead point to a CLSID, then perhaps that class could implement some interface and receive a flag like [CMIC_MASK_CONTROL_DOWN](https://docs.microsoft.com/windows/win32/api/shobjidl_core/ns-shobjidl_core-cminvokecommandinfo#cmic_mask_control_down).
Author
Owner

@vertigo220 commented on GitHub (Jul 25, 2022):

Appears to be a duplicate of #4459

@vertigo220 commented on GitHub (Jul 25, 2022): Appears to be a duplicate of #4459
Author
Owner

@akrantz commented on GitHub (Jul 25, 2022):

When I learned that holding Ctrl+Shift and clicking on the taskbar item will launch it elevated, I stopped trying to use right-click to run as Administrator. It still would be nice to have a discoverable option to do that. You can now right-click the taskbar item, then right-click "Windows Terminal" and get a "Run as Administrator" option, which is awkward for requiring two clicks. The other bug linked as a duplicate has lots of discussion about this, so I'll close this one.

@akrantz commented on GitHub (Jul 25, 2022): When I learned that holding Ctrl+Shift and clicking on the taskbar item will launch it elevated, I stopped trying to use right-click to run as Administrator. It still would be nice to have a discoverable option to do that. You can now right-click the taskbar item, then right-click "Windows Terminal" and get a "Run as Administrator" option, which is awkward for requiring two clicks. The other bug linked as a duplicate has lots of discussion about this, so I'll close this one.
Author
Owner

@akrantz commented on GitHub (Jul 25, 2022):

Well it doesn't seem like I can close the issue...

@akrantz commented on GitHub (Jul 25, 2022): Well it doesn't seem like I can close the issue...
Author
Owner

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

Wow this totally is a /dup of #4459. I can't believe I ever missed that.

@zadjii-msft commented on GitHub (Jul 25, 2022): Wow this totally is a /dup of #4459. I can't believe I ever missed that.
Author
Owner

@ghost commented on GitHub (Jul 25, 2022):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jul 25, 2022): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10739