I have Windows 11 Pro (21H2). I have Windows Terminal icon in the Taskbar. I always have to right-click on it, and click Run-As-Administrator. I'd rather have it run as Administrator by default. I can create a shortcut on my Desktop, and set it to run as administrator by default. But I want the Windows Taskbar icon to do that.
I have already changed the executable (WindowsTerminal.exe & wt.exe) to supposedly Run as Administrator, for all users. I've also dabbled with Troubleshooting Compatibility. Nothing makes the Windows Terminal icon ON THE TASKBAR open Windows Terminal in admin mode.
(It seems like you can't drag-and-drop shortcuts to the Taskbar anymore with Windows 11. So that won't work either.)
01 Answer
There may be an easier way (or perhaps not), but here is at least a method that works on Windows 11. It reads as a little convoluted, but that's mainly because I want to provide instructions that are as "failsafe" as possible:
Create a script, let's say
%userprofile%\Documents\Scripts\wt_as_admin.pswith the following:Start-Process wt -Verb RunAsTest it by right-clicking it in File Explorer and selecting Run with PowerShell. It should bring up the UAC and run Windows Terminal as admin.
In File Explorer, navigate to
%userprofile%\AppData\Roaming\Microsoft\Windows\Start Menu\ProgramsNew -> Shortcut
- For Location, just type
powershell.exe - Click Next
- For the Name, call it "Windows Terminal Admin" (or whatever you want)
- Click Finish
- For Location, just type
Right-click the shortcut you just created and select Properties
- You'll notice that Windows has expanded
powershell.exeto its full path. Add to that%userprofile\Documents\Scripts\wt_as_admin.ps(or wherever your script is). - Choose a suitable icon. You can find the Windows Terminal
.icofile in the Github repo here.
- You'll notice that Windows has expanded
Bring up the Windows Start menu
Search for "Windows Terminal Admin" (or whatever you called the shortcut)
Right-click on it and Pin to Taskbar