Command line to check if you admin rights and exit if not

net.exe session 1>NUL 2>NUL || (Echo This script requires admin elevated rights, exiting. & echo. & pause & Exit /b 1)

 

Posted on January 28, 2023, 7:51 pm By
Categories: tech tips Tags: