|
|
| Think about Loose Coupling | |
| PerlMonks |
Re^2: How to get system user name from windows using perlby Sinistral (Prior) |
| on Nov 10, 2011 at 14:01 UTC ( #937379=note: print w/ replies, xml ) | Need Help?? |
|
Au contraire, Windows absolutely does maintain the current user information. Although there isn't a native command to get it, a a quick Googling came across these options:
For a native Perl solution, there is: http://stackoverflow.com/questions/3526420/how-do-i-get-the-current-user-in-perl-in-a-portable-way/3531096#3531096. To keep information at PerlMonks, the answer cited refers to using Win32 which has a LoginName function (which doesn't return domain, if you're using Active Directory) or Win32::pwent.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||