25.10.2016, 23:13, "Doug Coleman" <doug.cole...@gmail.com>:
You should be able to call the Windows APIs directly (if you can figure out which ones!) and avoid using a script to call a binary.
That's true. I'm simply having fun with that little task. Parsing the output and such.
If I needed to solve that problem in a proper way, I would not mess with the whoami.exe, I'd look for WinAPI functions.
I'm not familiar with those, so can't really help here.
I have an issue with the formulation of the task, though. Why do we need to know if a user is an admin? Do we strictly want to check the Administrators group membership, or do we want to test for some specific access privileges? For instance, Power Users used to have some pretty big rights in their day, without being full admins.
There is also the issue with elevation, which gives a user some rights without making him/her an admin.
---=====---
Александр
------------------------------------------------------------------------------ The Command Line: Reinvented for Modern Developers Did the resurgence of CLI tooling catch you by surprise? Reconnect with the command line and become more productive. Learn the new .NET and ASP.NET CLI. Get your free copy! http://sdm.link/telerik
_______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk