I am trying to smoothly open an elevated tab in Windows Terminal starting from non-elevated. I noticed that this is possible on a REMOTE PC using psexec, but doesn’t quite work locally.
For opening a remote command line to another PC with elevated (admin) rights, I use this command line in Windows Terminal settings:
pathtopstoolsPsExec.exe \remotehostname cmd
This will open right within the same Windows Terminal as any other tab, even though it is elevated. Both my local PC and the remote PC are in the same domain and my account has admin rights on both. No UAC prompt is shown.
So I tried using a similar command to open an elevated prompt locally:
pathtopstoolsPsExec.exe \localhost cmd
Although this does open an elevated terminal there a UAC prompt and it is not within the same Windows Terminal window.
Is there some way to convince psexec to open the local prompt in the same way as it opens the remote prompt?
I tried https://code.kliu.org/misc/elevate/ as well, but it doesn’t work any better than psexec, actually seems less well integrated into Terminal.