Is there a way to check admin rights on Windows using Perl?

I am trying to create a basic starter script that determines which OS I work on and if any special modules need to be loaded. As for Linux, I can check root by looking at the effective uid $> , is there a way to do a similar operation on windows?

+6
source share
2 answers

Win32 can help you get your username on Windows.

+6
source
 if ( system("NET SESSION >NUL 2>&1") ) { ... } 
+1
source

Source: https://habr.com/ru/post/901487/


All Articles