windows - How to detect if CMD is running as Administrator/has elevated privileges? - Stack Overflow

windows - How to detect if CMD is running as Administrator/has elevated privileges? - Stack Overflow

瀏覽:1365
日期:2025-06-19
The easiest way to do this on Vista, Win 7 and above is enumerating token groups and looking for the current integrity level (or the administrators sid, if only group memberhip is important): Check if we are running elevated: whoami /groups | find "S-1-16...看更多