I've seen multiple questions on this topic and some answers about runas
but none of them was sufficient...
I need a Windows command to upgrade privileges of a terminal after it has already been opened with permissions of an average user. ie. To upgrade permissions for the whole terminal session and not just to run one command as administrator! Something just like sudo su
in Linux.
If anyone knows any trick to do this that would be much appreciated.
Edit:
Why I need this? I use the terminal in Visual Studio Code; it wouldn't let me run commands that require administrative permissions. It sucks to have to open an external terminal to do this... And currently, the only way I'm aware of to run a terminal in VS code in elevated permissions would be by editing the Code.exe's compatibility settings to run as administrator. But that adds more trouble because now it shows the user account control prompt every time I run an instance of VS Code.
Also creating a special shortcut to run VS Code in administrative mode wouldn't help because I run it from the context menu (Open With Code) so I don't have to manually navigate to the project folder.
sudo su
for Windows is the fact that there is no 100% equivalent on Windows. It is possible to create a shortcut file (.lnk
) with Target being%SystemRoot%\System32\cmd.exe /C "C:\Full Path\BatchFile.cmd"
with advanced property Run as administrator checked. That's it. A shortcut key can be configured for this shortcut file to run it from within any application. Option/C
can be replaced by option/K
. – Foote