Is it possible to switch from normal mode to administrator mode in command line? I don't want to open command line by right clicking and selecting "run as administrator". Thanks
The answer is no. The "full administrative token" is associated with an .EXE when it's launched. You need to start a new CMD.EXE to get full-admin privs. To make UAC a bit more bearable, you can enable "auto-admin approval" through group policy.
Or from within Powershell:
Start-Process powershell -Verb runas
How about this:
runas /user:administrator cmd.exe
You can't really "switch" between the two modes, but there are some 3rd party tools that let you launch programs from the command line in the elevated admin. Provided you drop them into a working path, you could, for example, use "elevate cmd" from the start menu or from an existing command prompt to start a new session in the elevated mode.
You can have a shortcut to cmd.exe and just modify the Advanced properties tab to "Run as Administrator".
if you are in visual studio code, in configuration you can add this:
"terminal.integrated.shellArgs.windows": [ "-Verb runas" ],