Check if current Command Prompt was launched as the Administrator

Posted by Canadian Luke on Super User See other posts from Super User or by Canadian Luke
Published on 2013-10-30T23:12:32Z Indexed on 2013/10/31 9:59 UTC
Read the original article Hit count: 217

Filed under:
|

I am looking to write a script that takes user input, then makes system wide changes. I need this to be very generic, but simply put, at the top, I need it to check to see if it's being run 'As an Administrator'. If it's not, then I want to display a message to tell them that; if it is, I want it to continue on. Is there a constant way to verify this? I am not looking to start a new session as the Administrator, I just want to detect if it's currently run as admin

© Super User or respective owner

Related posts about Windows

Related posts about command-line