W
W
WSGlebKavash2021-09-14 13:26:57
cmd/bat
WSGlebKavash, 2021-09-14 13:26:57

Command UAC?

In the Windows GUI, you can query Uac by right-clicking on the shortcut and selecting: "Run as administrator". If the user is in the group Администраторы, then he will need to click "OK", if not, then enter the administrator password and click "OK".
But what if there is no GUI, only SSH or Telnet? How to submit a UaC request via cmd/powershell and through which utilities?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2021-09-14
@WSGlebKavash

powershell Start-Process -FilePath "%0" -ArgumentList "%cd%" -verb runas >NUL 2>&1

if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
"Put your command here"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question