Run As Admin Check
ForeverZer0 Sep 3rd, 2012 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def elevated?
- whoami = `whoami /groups` rescue nil
- if whoami =~ /S-1-16-12288/
- admin = `net localgroup administrators | find "%USERNAME%"` rescue ""
- admin.empty? ? false : true
RAW Paste Data