Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the windows command to determine whether the batch is running with the highest level of administrator privileges

Shulou Source: shulou.com Published: 2022-06-02 23:55:47 10月04日 Update

@ echo off

At > nul

If errorlevel% equ 0 (echo ok) else echo Please switch to an administrator account to run this batchboxes!

@ echo off

Whoami / groups | find "Smuri 1-16-12288" > nul

If ERRORLEVEL 1 (echo [ERROR] This script has to be executed with administrator privilegs) else echo [OK]

Tags: Supreme Command Supreme permissions Administrator Administration run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Shulou Technology MariaDB macOS